2016-12-22 14:09:16 +01:00
|
|
|
import 'whatwg-fetch';
|
2016-12-20 19:15:12 +01:00
|
|
|
import 'react-mdl/extra/material.js';
|
|
|
|
|
2019-03-11 21:10:45 +01:00
|
|
|
import 'react-mdl/extra/css/material.blue_grey-pink.min.css';
|
|
|
|
|
2016-11-10 14:26:24 +01:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2018-08-06 22:16:36 +02:00
|
|
|
import { HashRouter, Route } from 'react-router-dom';
|
2016-11-10 14:26:24 +01:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import thunkMiddleware from 'redux-thunk';
|
2017-01-06 11:52:44 +01:00
|
|
|
import { createStore, applyMiddleware, compose } from 'redux';
|
2016-11-10 14:26:24 +01:00
|
|
|
|
|
|
|
import store from './store';
|
2018-01-29 09:07:10 +01:00
|
|
|
import MetricsPoller from './metrics-poller';
|
2016-11-10 14:26:24 +01:00
|
|
|
import App from './component/app';
|
2018-08-06 22:16:36 +02:00
|
|
|
import ScrollToTop from './component/scroll-to-top';
|
2016-11-10 14:26:24 +01:00
|
|
|
|
2017-01-06 11:52:44 +01:00
|
|
|
let composeEnhancers;
|
|
|
|
|
2017-08-28 21:40:44 +02:00
|
|
|
if (process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) {
|
2017-01-06 11:52:44 +01:00
|
|
|
composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
|
|
} else {
|
|
|
|
composeEnhancers = compose;
|
|
|
|
}
|
|
|
|
|
2017-08-28 21:40:44 +02:00
|
|
|
const unleashStore = createStore(store, composeEnhancers(applyMiddleware(thunkMiddleware)));
|
2018-01-29 09:07:10 +01:00
|
|
|
const metricsPoller = new MetricsPoller(unleashStore);
|
|
|
|
metricsPoller.start();
|
2016-11-10 14:26:24 +01:00
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<Provider store={unleashStore}>
|
2018-08-06 22:16:36 +02:00
|
|
|
<HashRouter>
|
|
|
|
<ScrollToTop>
|
|
|
|
<Route path="/" component={App} />
|
|
|
|
</ScrollToTop>
|
|
|
|
</HashRouter>
|
2017-08-28 19:15:47 +02:00
|
|
|
</Provider>,
|
|
|
|
document.getElementById('app')
|
|
|
|
);
|