p5.js-web-editor/client/index.jsx

38 lines
937 B
React
Raw Normal View History

import React from 'react';
import { render } from 'react-dom';
import { hot } from 'react-hot-loader/root';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
2020-01-19 22:05:16 +01:00
import { ThemeProvider } from 'styled-components';
import configureStore from './store';
import routes from './routes';
2020-01-19 22:05:16 +01:00
import theme, { Theme } from './theme';
require('./styles/main.scss');
// Load the p5 png logo, so that webpack will use it
require('./images/p5js-square-logo.png');
const history = browserHistory;
const initialState = window.__INITIAL_STATE__;
const store = configureStore(initialState);
2020-01-19 22:05:16 +01:00
const currentTheme = Theme.light;
2018-05-03 02:34:03 +02:00
const App = () => (
<ThemeProvider theme={{ ...theme[currentTheme] }}>
2020-01-19 22:05:16 +01:00
<Provider store={store}>
<Router history={history} routes={routes(store)} />
</Provider>
</ThemeProvider>
2018-05-03 02:34:03 +02:00
);
const HotApp = hot(App);
2018-05-03 02:34:03 +02:00
render(
<HotApp />,
document.getElementById('root')
);