mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
31 lines
805 B
TypeScript
31 lines
805 B
TypeScript
import React from 'react';
|
|
import ReactDOM from 'react-dom/client';
|
|
import App from './app';
|
|
import { HashRouter as Router } from 'react-router-dom';
|
|
import './lib/init-translations';
|
|
import './index.css';
|
|
import './themes.css';
|
|
import { App as CapacitorApp } from '@capacitor/app';
|
|
import * as serviceWorkerRegistration from './service-worker-registration';
|
|
|
|
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
|
root.render(
|
|
<React.StrictMode>
|
|
<Router>
|
|
<App />
|
|
</Router>
|
|
</React.StrictMode>,
|
|
);
|
|
|
|
// set up PWA https://cra.link/PWA
|
|
serviceWorkerRegistration.register();
|
|
|
|
// add back button in android app
|
|
CapacitorApp.addListener('backButton', ({ canGoBack }) => {
|
|
if (canGoBack) {
|
|
window.history.back();
|
|
} else {
|
|
CapacitorApp.exitApp();
|
|
}
|
|
});
|