2018-02-05 17:12:47 +02:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2018-02-20 02:35:31 +02:00
|
|
|
import { ThemeProvider, consolidateStreamedStyles } from 'styled-components';
|
|
|
|
import { Provider as ReduxProvider } from 'react-redux';
|
|
|
|
import { ApolloProvider } from 'react-apollo';
|
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
2018-02-05 17:12:47 +02:00
|
|
|
import isFunction from 'lodash.isfunction';
|
|
|
|
import isFinite from 'lodash.isfinite';
|
|
|
|
|
2018-02-20 02:35:31 +02:00
|
|
|
import { theme } from 'joyent-ui-toolkit';
|
|
|
|
|
|
|
|
import createStore from '@state/redux-store';
|
|
|
|
import createClient from '@state/apollo-client';
|
2018-02-05 17:12:47 +02:00
|
|
|
import { register } from './sw';
|
|
|
|
import App from './app';
|
|
|
|
|
|
|
|
if (!isFunction(Number.isFinite)) {
|
|
|
|
Number.isFinite = isFinite;
|
|
|
|
}
|
|
|
|
|
2018-02-20 02:35:31 +02:00
|
|
|
consolidateStreamedStyles();
|
|
|
|
|
|
|
|
ReactDOM.hydrate(
|
|
|
|
<ApolloProvider client={createClient()}>
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<ReduxProvider store={createStore()}>
|
|
|
|
<BrowserRouter>
|
|
|
|
<App />
|
|
|
|
</BrowserRouter>
|
|
|
|
</ReduxProvider>
|
|
|
|
</ThemeProvider>
|
|
|
|
</ApolloProvider>,
|
|
|
|
document.getElementById('root')
|
|
|
|
);
|
2018-02-05 17:12:47 +02:00
|
|
|
|
|
|
|
register();
|