2018-02-05 17:12:47 +02:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2018-04-24 16:17:26 +03:00
|
|
|
import { HelmetProvider } from 'react-helmet-async';
|
2018-03-06 03:14:33 +02:00
|
|
|
import { ThemeProvider } from 'styled-components';
|
2018-02-20 02:35:31 +02:00
|
|
|
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 App from './app';
|
|
|
|
|
|
|
|
if (!isFunction(Number.isFinite)) {
|
|
|
|
Number.isFinite = isFinite;
|
|
|
|
}
|
|
|
|
|
2018-02-20 02:35:31 +02:00
|
|
|
ReactDOM.hydrate(
|
|
|
|
<ApolloProvider client={createClient()}>
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<ReduxProvider store={createStore()}>
|
|
|
|
<BrowserRouter>
|
2018-04-24 16:17:26 +03:00
|
|
|
<HelmetProvider context={{}}>
|
|
|
|
<App />
|
|
|
|
</HelmetProvider>
|
2018-02-20 02:35:31 +02:00
|
|
|
</BrowserRouter>
|
|
|
|
</ReduxProvider>
|
|
|
|
</ThemeProvider>
|
|
|
|
</ApolloProvider>,
|
|
|
|
document.getElementById('root')
|
|
|
|
);
|