forked from discretize/discretize-gear-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-browser.js
26 lines (22 loc) · 927 Bytes
/
gatsby-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* eslint-disable import/prefer-default-export */
/* eslint-disable react/jsx-filename-extension */
import React from 'react';
import { Provider } from 'react-redux';
import { ThemeProvider, Spinner } from 'gw2-ui-bulk';
import { PersistGate } from 'redux-persist/integration/react';
import baseTheme from './src/styles/baseTheme';
import 'typeface-fira-mono';
import 'typeface-menomonia';
import 'typeface-muli';
import 'typeface-raleway';
import createStore from './src/state/createStore';
const { store, persistor } = createStore();
export const wrapRootElement = ({ element }) => (
<Provider store={store}>
{/* TODO fix redux-persist breaking template swapping <PersistGate loading={<Spinner />} persistor={persistor}> */}
<PersistGate loading={<Spinner />} persistor={persistor}>
<ThemeProvider theme={baseTheme}>{element}</ThemeProvider>
</PersistGate>
{/* </PersistGate> */}
</Provider>
);