mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { render } from 'react-dom';
|
|
import { Provider } from 'react-redux';
|
|
import { BrowserRouter } from 'react-router-dom';
|
|
import pack from '../package.json';
|
|
import { container } from './container';
|
|
import { store } from './container/store';
|
|
import { fixLeafletIcons } from './utils/helpers/leaflet';
|
|
import { register as registerServiceWorker } from './serviceWorkerRegistration';
|
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
import 'leaflet/dist/leaflet.css';
|
|
import './index.scss';
|
|
|
|
// This overwrites icons used for leaflet maps, fixing some issues caused by webpack while processing the CSS
|
|
fixLeafletIcons();
|
|
|
|
const { App, ScrollToTop, ErrorHandler, appUpdateAvailable } = container;
|
|
|
|
render(
|
|
<Provider store={store}>
|
|
<BrowserRouter basename={pack.homepage}>
|
|
<ErrorHandler>
|
|
<ScrollToTop>
|
|
<App />
|
|
</ScrollToTop>
|
|
</ErrorHandler>
|
|
</BrowserRouter>
|
|
</Provider>,
|
|
document.getElementById('root'),
|
|
);
|
|
|
|
// Learn more about service workers: https://cra.link/PWA
|
|
registerServiceWorker({
|
|
onUpdate() {
|
|
store.dispatch(appUpdateAvailable());
|
|
},
|
|
});
|