forked from dscnitrourkela/project-raisin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-ssr.js
75 lines (71 loc) · 2.12 KB
/
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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import './src/styles/global.css';
import 'react-toastify/dist/ReactToastify.css';
import React from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ToastContainer } from 'react-toastify';
import AuthContextProvider from './src/utils/Auth';
import { Layout } from './src/components';
const queryClient = new QueryClient();
export const onRenderBody = ({ setHeadComponents }) => {
// @import url('fonts/Roslindale/font.css');
setHeadComponents([
<link
rel='preload'
href='/fonts/Roslindale/fonts/RoslindaleText-BoldItalic-Testing.woff'
as='font'
type='font/woff'
crossOrigin='anonymous'
key='Roslindale'
/>,
<link
rel='preload'
href='/fonts/Roslindale/fonts/RoslindaleText-Bold-Testing.woff2'
as='font'
type='font/woff2'
crossOrigin='anonymous'
key='Roslindale2'
/>,
<link
rel='preload'
href='/fonts/Roslindale/fonts/RoslindaleText-MediumItalic-Testing.woff'
as='font'
type='font/woff'
crossOrigin='anonymous'
key='Roslindale3'
/>,
<link
rel='preload'
href='/fonts/Roslindale/fonts/RoslindaleText-MediumItalic-Testing.woff2'
as='font'
type='font/woff2'
crossOrigin='anonymous'
key='Roslindale4'
/>,
<link
rel='preload'
href='/fonts/Roslindale/fonts/RoslindaleDeckNarrow-SemiBoldItalic-Testing.woff'
as='font'
type='font/woff'
crossOrigin='anonymous'
key='Roslindale5'
/>,
<link
rel='preload'
href='/fonts/Roslindale/fonts/RoslindaleDeckNarrow-SemiBoldItalic-Testing.woff2'
as='font'
type='font/woff2'
crossOrigin='anonymous'
key='Roslindale6'
/>,
]);
};
export const wrapPageElement = ({ element, props }) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<Layout {...props}>{element}</Layout>
);
export const wrapRootElement = ({ element }) => (
<QueryClientProvider client={queryClient}>
<AuthContextProvider>{element}</AuthContextProvider>
<ToastContainer position='bottom-right' autoClose={3000} />
</QueryClientProvider>
);