1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/index.jsx
ivaosthu c4900262f2 feat: Customisable UI via config
This feature enables overrides of certain UI elements from the API
such as setting a different background color for the header.

This will make it easier to customise the UI in different environemnt.
2019-03-13 08:49:50 +01:00

40 lines
1.2 KiB
JavaScript

import 'whatwg-fetch';
import 'react-mdl/extra/material.js';
import 'react-mdl/extra/css/material.blue_grey-pink.min.css';
import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter, Route } from 'react-router-dom';
import { Provider } from 'react-redux';
import thunkMiddleware from 'redux-thunk';
import { createStore, applyMiddleware, compose } from 'redux';
import store from './store';
import MetricsPoller from './metrics-poller';
import App from './component/app';
import ScrollToTop from './component/scroll-to-top';
let composeEnhancers;
if (process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) {
composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
} else {
composeEnhancers = compose;
}
const unleashStore = createStore(store, composeEnhancers(applyMiddleware(thunkMiddleware)));
const metricsPoller = new MetricsPoller(unleashStore);
metricsPoller.start();
ReactDOM.render(
<Provider store={unleashStore}>
<HashRouter>
<ScrollToTop>
<Route path="/" component={App} />
</ScrollToTop>
</HashRouter>
</Provider>,
document.getElementById('app')
);