aboutsummaryrefslogtreecommitdiff
path: root/modern/src/index.js
diff options
context:
space:
mode:
authorBoubrid Ihab <boubrid.ihab@gmail.com>2022-05-23 17:15:39 +0100
committerBoubrid Ihab <boubrid.ihab@gmail.com>2022-05-23 17:15:39 +0100
commit0b9209f877c42d9eb69d4b94cfa9c7f16a81967e (patch)
tree72286ee879bea52fa2dad73f36d1e2b36a35bc15 /modern/src/index.js
parentc30e57579868b8f3d21e6e6083e37cba8bcfa408 (diff)
parent0ed610e71b28461d6c9cc996764b00db5ac0b2ba (diff)
downloadtrackermap-web-0b9209f877c42d9eb69d4b94cfa9c7f16a81967e.tar.gz
trackermap-web-0b9209f877c42d9eb69d4b94cfa9c7f16a81967e.tar.bz2
trackermap-web-0b9209f877c42d9eb69d4b94cfa9c7f16a81967e.zip
Merge branch 'master' of github.com:traccar/traccar-web into fix-key-issue
Diffstat (limited to 'modern/src/index.js')
-rw-r--r--modern/src/index.js38
1 files changed, 26 insertions, 12 deletions
diff --git a/modern/src/index.js b/modern/src/index.js
index cb6710d5..547e39ef 100644
--- a/modern/src/index.js
+++ b/modern/src/index.js
@@ -3,22 +3,36 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
-
-import App from './App';
+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' : null;
+const base = window.location.href.indexOf('modern') >= 0 ? '/modern' : '/';
-ReactDOM.render((
- <Provider store={store}>
- <LocalizationProvider>
- <BrowserRouter basename={base}>
- <App />
- </BrowserRouter>
- </LocalizationProvider>
- </Provider>
-), document.getElementById('root'));
+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();