2018-10-30 22:41:36 +03:00
|
|
|
import { render } from 'react-dom';
|
2018-06-03 21:12:40 +03:00
|
|
|
import { Provider } from 'react-redux';
|
2018-06-03 14:15:52 +03:00
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
2018-11-01 10:20:33 +03:00
|
|
|
import { homepage } from '../package.json';
|
2018-12-17 22:03:36 +03:00
|
|
|
import container from './container';
|
2018-12-18 00:18:47 +03:00
|
|
|
import store from './container/store';
|
2020-08-22 19:32:48 +03:00
|
|
|
import { fixLeafletIcons } from './utils/helpers/leaflet';
|
2021-06-06 19:41:10 +03:00
|
|
|
import { register as registerServiceWorker } from './serviceWorkerRegistration';
|
2019-01-07 23:00:28 +03:00
|
|
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
|
|
import 'leaflet/dist/leaflet.css';
|
2018-12-17 22:03:36 +03:00
|
|
|
import './index.scss';
|
2018-05-13 09:57:47 +03:00
|
|
|
|
2019-01-07 23:00:28 +03:00
|
|
|
// This overwrites icons used for leaflet maps, fixing some issues caused by webpack while processing the CSS
|
|
|
|
fixLeafletIcons();
|
|
|
|
|
2021-06-06 19:41:10 +03:00
|
|
|
const { App, ScrollToTop, ErrorHandler, appUpdateAvailable } = container;
|
2018-06-03 21:12:40 +03:00
|
|
|
|
2018-10-30 22:41:36 +03:00
|
|
|
render(
|
2018-06-03 21:12:40 +03:00
|
|
|
<Provider store={store}>
|
2018-11-01 10:20:33 +03:00
|
|
|
<BrowserRouter basename={homepage}>
|
2019-03-04 22:40:26 +03:00
|
|
|
<ErrorHandler>
|
|
|
|
<ScrollToTop>
|
|
|
|
<App />
|
|
|
|
</ScrollToTop>
|
|
|
|
</ErrorHandler>
|
2018-06-03 21:12:40 +03:00
|
|
|
</BrowserRouter>
|
|
|
|
</Provider>,
|
2020-08-22 09:10:31 +03:00
|
|
|
document.getElementById('root'),
|
2018-06-03 14:15:52 +03:00
|
|
|
);
|
2021-06-06 13:26:43 +03:00
|
|
|
|
|
|
|
// If you want your app to work offline and load faster, you can change
|
|
|
|
// unregister() to register() below. Note this comes with some pitfalls.
|
|
|
|
// Learn more about service workers: https://cra.link/PWA
|
2021-06-06 19:41:10 +03:00
|
|
|
registerServiceWorker({
|
|
|
|
onUpdate() {
|
|
|
|
store.dispatch(appUpdateAvailable()); // eslint-disable-line @typescript-eslint/no-unsafe-call
|
|
|
|
},
|
|
|
|
});
|