2022-04-02 08:50:59 +02:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2018-06-03 20:12:40 +02:00
|
|
|
import { Provider } from 'react-redux';
|
2018-06-03 13:15:52 +02:00
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
2022-03-24 21:27:33 +01:00
|
|
|
import pack from '../package.json';
|
2021-12-23 17:53:06 +01:00
|
|
|
import { container } from './container';
|
2022-11-02 20:40:14 +01:00
|
|
|
import { setUpStore } from './container/store';
|
2021-06-06 18:41:10 +02:00
|
|
|
import { register as registerServiceWorker } from './serviceWorkerRegistration';
|
2018-12-17 20:03:36 +01:00
|
|
|
import './index.scss';
|
2018-05-13 08:57:47 +02:00
|
|
|
|
2022-11-02 20:40:14 +01:00
|
|
|
const store = setUpStore(container);
|
2021-06-06 18:41:10 +02:00
|
|
|
const { App, ScrollToTop, ErrorHandler, appUpdateAvailable } = container;
|
2018-06-03 20:12:40 +02:00
|
|
|
|
2024-10-12 20:06:48 +02:00
|
|
|
createRoot(document.getElementById('root')!).render(
|
2018-06-03 20:12:40 +02:00
|
|
|
<Provider store={store}>
|
2022-03-24 21:27:33 +01:00
|
|
|
<BrowserRouter basename={pack.homepage}>
|
2019-03-04 20:40:26 +01:00
|
|
|
<ErrorHandler>
|
|
|
|
<ScrollToTop>
|
|
|
|
<App />
|
|
|
|
</ScrollToTop>
|
|
|
|
</ErrorHandler>
|
2018-06-03 20:12:40 +02:00
|
|
|
</BrowserRouter>
|
|
|
|
</Provider>,
|
2018-06-03 13:15:52 +02:00
|
|
|
);
|
2021-06-06 12:26:43 +02:00
|
|
|
|
|
|
|
// Learn more about service workers: https://cra.link/PWA
|
2021-06-06 18:41:10 +02:00
|
|
|
registerServiceWorker({
|
|
|
|
onUpdate() {
|
2022-03-26 13:07:58 +01:00
|
|
|
store.dispatch(appUpdateAvailable());
|
2021-06-06 18:41:10 +02:00
|
|
|
},
|
|
|
|
});
|