2017-09-20 12:30:53 +03:00
|
|
|
import React from 'react';
|
|
|
|
import { ThemeProvider } from 'styled-components';
|
2018-01-17 21:10:39 +02:00
|
|
|
import { Provider as ReduxProvider } from 'react-redux';
|
2017-09-20 12:30:53 +03:00
|
|
|
import { ApolloProvider } from 'react-apollo';
|
|
|
|
|
|
|
|
import { theme, RootContainer } from 'joyent-ui-toolkit';
|
|
|
|
|
|
|
|
import { client, store } from '@state/store';
|
|
|
|
import Router from '@root/router';
|
2017-11-28 16:50:55 +02:00
|
|
|
import remcalc from 'remcalc';
|
|
|
|
|
2017-12-21 02:12:42 +02:00
|
|
|
const { NODE_ENV } = process.env;
|
|
|
|
const IS_PRODUCTION = NODE_ENV === 'production';
|
|
|
|
|
2017-11-28 16:50:55 +02:00
|
|
|
const fullTheme = {
|
|
|
|
...theme,
|
2017-12-21 02:12:42 +02:00
|
|
|
font: {
|
|
|
|
...theme.font,
|
|
|
|
href: !IS_PRODUCTION
|
|
|
|
? theme.font.href
|
|
|
|
: () =>
|
|
|
|
'https://fonts.googleapis.com/css?family=Libre+Franklin:400,500,600'
|
|
|
|
},
|
2017-11-28 16:50:55 +02:00
|
|
|
flexboxgrid: {
|
|
|
|
gridSize: 12, // rem
|
|
|
|
gutterWidth: 1.25, // rem
|
|
|
|
outerMargin: 1.875, // rem
|
|
|
|
mediaQuery: 'only screen',
|
|
|
|
container: {
|
|
|
|
sm: 46, // rem
|
|
|
|
md: 56, // rem
|
|
|
|
lg: 59 // rem
|
|
|
|
},
|
|
|
|
breakpoints: {
|
|
|
|
xs: 0, // em
|
|
|
|
sm: 48, // em
|
|
|
|
md: 64, // em
|
|
|
|
lg: 75 // em
|
|
|
|
}
|
|
|
|
},
|
|
|
|
spacing: {
|
|
|
|
0.5: remcalc(4),
|
|
|
|
0: remcalc(0),
|
|
|
|
1: remcalc(6),
|
|
|
|
2: remcalc(12),
|
|
|
|
3: remcalc(18),
|
|
|
|
4: remcalc(24),
|
|
|
|
5: remcalc(30),
|
|
|
|
6: remcalc(36),
|
|
|
|
7: remcalc(42),
|
|
|
|
8: remcalc(48),
|
|
|
|
9: remcalc(54),
|
|
|
|
10: remcalc(60)
|
|
|
|
}
|
|
|
|
};
|
2017-09-20 12:30:53 +03:00
|
|
|
|
|
|
|
export default () => (
|
2018-01-17 21:10:39 +02:00
|
|
|
<ApolloProvider client={client}>
|
2017-11-28 16:50:55 +02:00
|
|
|
<ThemeProvider theme={fullTheme}>
|
2018-01-17 21:10:39 +02:00
|
|
|
<ReduxProvider store={store}>
|
|
|
|
<RootContainer>
|
|
|
|
<Router />
|
|
|
|
</RootContainer>
|
|
|
|
</ReduxProvider>
|
2017-09-20 12:30:53 +03:00
|
|
|
</ThemeProvider>
|
|
|
|
</ApolloProvider>
|
|
|
|
);
|