2021-05-07 08:31:25 +02:00
|
|
|
import './wdyr';
|
2016-12-22 14:09:16 +01:00
|
|
|
import 'whatwg-fetch';
|
2016-12-20 19:15:12 +01:00
|
|
|
|
2021-02-25 10:54:53 +01:00
|
|
|
import './app.css';
|
2019-03-11 21:10:45 +01:00
|
|
|
|
2016-11-10 14:26:24 +01:00
|
|
|
import ReactDOM from 'react-dom';
|
2021-05-04 09:59:42 +02:00
|
|
|
import { Route, BrowserRouter as Router } from 'react-router-dom';
|
2016-11-10 14:26:24 +01:00
|
|
|
import { Provider } from 'react-redux';
|
2021-03-30 15:14:02 +02:00
|
|
|
import { ThemeProvider, CssBaseline } from '@material-ui/core';
|
2016-11-10 14:26:24 +01:00
|
|
|
import thunkMiddleware from 'redux-thunk';
|
2017-01-06 11:52:44 +01:00
|
|
|
import { createStore, applyMiddleware, compose } from 'redux';
|
2021-04-27 09:48:00 +02:00
|
|
|
import { DndProvider } from 'react-dnd';
|
|
|
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
2021-03-30 15:14:02 +02:00
|
|
|
import { StylesProvider } from '@material-ui/core/styles';
|
2016-11-10 14:26:24 +01:00
|
|
|
|
2021-03-30 15:14:02 +02:00
|
|
|
import mainTheme from './themes/main-theme';
|
2016-11-10 14:26:24 +01:00
|
|
|
import store from './store';
|
2021-05-04 09:59:42 +02:00
|
|
|
import App from './component/AppContainer';
|
2018-08-06 22:16:36 +02:00
|
|
|
import ScrollToTop from './component/scroll-to-top';
|
2020-10-04 19:42:24 +02:00
|
|
|
import { writeWarning } from './security-logger';
|
2021-10-19 13:08:25 +02:00
|
|
|
import AccessProvider from './component/providers/AccessProvider/AccessProvider';
|
2021-05-04 09:59:42 +02:00
|
|
|
import { getBasePath } from './utils/format-path';
|
2022-01-14 15:50:02 +01:00
|
|
|
import UIProvider from './component/providers/UIProvider/UIProvider';
|
2016-11-10 14:26:24 +01:00
|
|
|
|
2017-01-06 11:52:44 +01:00
|
|
|
let composeEnhancers;
|
|
|
|
|
2021-04-12 15:04:03 +02:00
|
|
|
if (
|
|
|
|
process.env.NODE_ENV !== 'production' &&
|
|
|
|
(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
|
|
) {
|
2021-04-07 09:04:48 +02:00
|
|
|
composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
2017-01-06 11:52:44 +01:00
|
|
|
} else {
|
|
|
|
composeEnhancers = compose;
|
2020-10-04 19:42:24 +02:00
|
|
|
writeWarning();
|
2017-01-06 11:52:44 +01:00
|
|
|
}
|
|
|
|
|
2021-04-12 15:04:03 +02:00
|
|
|
const unleashStore = createStore(
|
|
|
|
store,
|
|
|
|
composeEnhancers(applyMiddleware(thunkMiddleware))
|
|
|
|
);
|
2016-11-10 14:26:24 +01:00
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<Provider store={unleashStore}>
|
2021-04-27 09:48:00 +02:00
|
|
|
<DndProvider backend={HTML5Backend}>
|
2022-01-14 15:50:02 +01:00
|
|
|
<UIProvider>
|
2022-02-10 17:04:10 +01:00
|
|
|
<AccessProvider>
|
2022-01-14 15:50:02 +01:00
|
|
|
<Router basename={`${getBasePath()}`}>
|
|
|
|
<ThemeProvider theme={mainTheme}>
|
|
|
|
<StylesProvider injectFirst>
|
|
|
|
<CssBaseline />
|
|
|
|
<ScrollToTop>
|
|
|
|
<Route path="/" component={App} />
|
|
|
|
</ScrollToTop>
|
|
|
|
</StylesProvider>
|
|
|
|
</ThemeProvider>
|
|
|
|
</Router>
|
|
|
|
</AccessProvider>
|
|
|
|
</UIProvider>
|
2021-04-27 09:48:00 +02:00
|
|
|
</DndProvider>
|
2017-08-28 19:15:47 +02:00
|
|
|
</Provider>,
|
|
|
|
document.getElementById('app')
|
|
|
|
);
|