aboutsummaryrefslogtreecommitdiff
path: root/modern/src/index.js
blob: 547e39efa4f1253c98a7575a4616e3f665e53779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import 'typeface-roboto';
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { CssBaseline, ThemeProvider, StyledEngineProvider } from '@mui/material';
import * as serviceWorker from './serviceWorker';
import store from './store';
import { LocalizationProvider } from './common/components/LocalizationProvider';
import ErrorHandler from './common/components/ErrorHandler';
import CachingController from './CachingController';
import SocketController from './SocketController';
import theme from './common/theme';
import Navigation from './Navigation';

const base = window.location.href.indexOf('modern') >= 0 ? '/modern' : '/';

ReactDOM.render(
  (
    <Provider store={store}>
      <LocalizationProvider>
        <StyledEngineProvider injectFirst>
          <ThemeProvider theme={theme}>
            <CssBaseline />
            <BrowserRouter basename={base}>
              <SocketController />
              <CachingController />
              <Navigation />
            </BrowserRouter>
            <ErrorHandler />
          </ThemeProvider>
        </StyledEngineProvider>
      </LocalizationProvider>
    </Provider>
  ), document.getElementById('root'),
);

serviceWorker.register();