2020-07-06 11:36:45 +02:00
|
|
|
import React, { Suspense } from 'react';
|
2016-11-09 00:54:54 +01:00
|
|
|
import { render } from 'react-dom';
|
2019-08-28 22:08:40 +02:00
|
|
|
import { hot } from 'react-hot-loader/root';
|
2016-11-09 00:54:54 +01:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { Router, browserHistory } from 'react-router';
|
2020-01-19 22:05:16 +01:00
|
|
|
|
2016-11-09 00:54:54 +01:00
|
|
|
import configureStore from './store';
|
|
|
|
import routes from './routes';
|
2020-04-19 22:41:44 +02:00
|
|
|
import ThemeProvider from './modules/App/components/ThemeProvider';
|
2020-07-06 11:36:45 +02:00
|
|
|
import Loader from './modules/App/components/loader';
|
|
|
|
import i18n from './i18n';
|
2016-11-09 00:54:54 +01:00
|
|
|
|
|
|
|
require('./styles/main.scss');
|
|
|
|
|
2018-10-03 03:03:33 +02:00
|
|
|
// Load the p5 png logo, so that webpack will use it
|
|
|
|
require('./images/p5js-square-logo.png');
|
|
|
|
|
2016-11-09 00:54:54 +01:00
|
|
|
const history = browserHistory;
|
|
|
|
const initialState = window.__INITIAL_STATE__;
|
2019-06-06 23:17:33 +02:00
|
|
|
|
2016-11-09 00:54:54 +01:00
|
|
|
const store = configureStore(initialState);
|
|
|
|
|
2018-05-03 02:34:03 +02:00
|
|
|
const App = () => (
|
2020-04-19 22:41:44 +02:00
|
|
|
<Provider store={store}>
|
|
|
|
<ThemeProvider>
|
2020-01-19 22:05:16 +01:00
|
|
|
<Router history={history} routes={routes(store)} />
|
2020-04-19 22:41:44 +02:00
|
|
|
</ThemeProvider>
|
|
|
|
</Provider>
|
2018-05-03 02:34:03 +02:00
|
|
|
);
|
|
|
|
|
2019-08-28 22:08:40 +02:00
|
|
|
const HotApp = hot(App);
|
2018-05-03 02:34:03 +02:00
|
|
|
|
|
|
|
render(
|
2020-07-06 11:36:45 +02:00
|
|
|
<Suspense fallback={(<Loader />)}>
|
|
|
|
<HotApp />
|
|
|
|
</Suspense>,
|
2017-02-22 20:29:35 +01:00
|
|
|
document.getElementById('root')
|
2016-11-09 00:54:54 +01:00
|
|
|
);
|