-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathgatsby-ssr.tsx
51 lines (48 loc) · 1.41 KB
/
gatsby-ssr.tsx
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react';
import Layout from './src/components/Layout';
import { type GatsbySSR } from 'gatsby';
import { ConfigProvider, theme } from 'antd';
import { ProConfigProvider } from '@ant-design/pro-components';
import { DBProvider } from './src/hooks/db';
export const wrapPageElement: GatsbySSR['wrapPageElement'] = ({
element,
props,
}) => {
return <Layout {...props}>{element}</Layout>;
};
export const wrapRootElement: GatsbySSR['wrapRootElement'] = ({ element }) => {
return (
<ProConfigProvider hashed={false}>
<ConfigProvider
theme={{
algorithm: theme.darkAlgorithm,
}}
>
<DBProvider>{element}</DBProvider>
</ConfigProvider>
</ProConfigProvider>
);
};
export const onRenderBody: GatsbySSR['onRenderBody'] = ({
setHeadComponents,
setHtmlAttributes,
}) => {
setHeadComponents([
<meta
name="title"
content="DRG Completionist — Progress Tracker for Deep Rock Galactic"
/>,
<meta
name="description"
content="A free, open-source progressive web app that assists hard-working dwarves like yourselves in keeping track of all those gizmos cluttering up your Space Rig."
/>,
<script
key="umami"
async
src="https://analytics.umami.is/script.js"
data-website-id="2b37ffbd-fdcf-49cc-a00b-de91a36a550d"
data-do-not-track="true"
/>,
]);
setHtmlAttributes({ lang: 'en' });
};