-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path_document.tsx
42 lines (38 loc) · 1.09 KB
/
_document.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
import React from 'react';
import Document, {Head, Html, Main, NextScript} from 'next/document';
import PatternBackground from 'components/icons/PatternBackground';
import type {DocumentContext, DocumentInitialProps} from 'next/document';
import type {ReactElement} from 'react';
class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx);
return {...initialProps};
}
render(): ReactElement {
return (
<Html lang={'en'}>
<Head>
<link
rel={'preconnect'}
href={'https://fonts.googleapis.com'}
/>
<link
rel={'preconnect'}
href={'https://fonts.gstatic.com'}
crossOrigin={'anonymous'}
/>
<link
href={'https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap'}
rel={'stylesheet'}
/>
</Head>
<body className={'bg-primary-50 transition-colors duration-150'}>
<PatternBackground />
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;