forked from makerdao/community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
25 lines (20 loc) · 830 Bytes
/
gatsby-ssr.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
//Load our Primsjs css and Fonts
import '@styles/global.css'; //<- Load in Prismjs css. Our custom styles have to be loaded this way cause Prismjs is blackboxed from our own code.
import { InitializeColorMode, jsx } from 'theme-ui';
import { Layout } from '@layouts';
import { NavigationProvider } from '@modules/navigation';
import React from 'react';
import { TranslationProvider } from '@modules/localization';
export const wrapRootElement = ({ element }) => (
<TranslationProvider>{element}</TranslationProvider>
);
export const wrapPageElement = ({ element, props }) => (
<NavigationProvider>
<Layout {...props}>{element}</Layout>
</NavigationProvider>
);
export const onRenderBody = ({ setPreBodyComponents }) => {
setPreBodyComponents([
jsx(InitializeColorMode, { key: 'theme-ui-no-flash' }),
]);
};