-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-browser.js
More file actions
29 lines (25 loc) · 833 Bytes
/
gatsby-browser.js
File metadata and controls
29 lines (25 loc) · 833 Bytes
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
27
28
29
import React from "react"
import { Provider } from "react-redux"
import { PersistGate } from "redux-persist/integration/react"
import { ThemeProvider } from 'styled-components';
import GlobalStyle from './src/lib/global-styles';
import configureStore from "./src/redux/configure-store"
import { theme } from './src/lib/constants';
import LoadingPage from "./src/components/Layout/LoadingPage"
const { store, persistor } = configureStore()
/* eslint-disable react/prop-types */
export const wrapRootElement = ({ element }) => (
<Provider store={store}>
<PersistGate loading={<LoadingPage />} persistor={persistor}>
{element}
</PersistGate>
</Provider>
);
export const wrapPageElement = ({ element }) => (
<ThemeProvider theme={theme}>
<>
<GlobalStyle />
{element}
</>
</ThemeProvider>
);