Skip to content

Commit

Permalink
feat: convert Document to functional component
Browse files Browse the repository at this point in the history
Convert custom Document from class to react fc
  • Loading branch information
mateusfg7 committed Dec 12, 2022
1 parent 94ec55f commit fb20dd0
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
import React from 'react'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import { Html, Head, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
render(): JSX.Element {
return (
<Html lang="en">
<Head>
<meta charSet="utf-8" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@200;300;400;600;800;900&display=swap"
rel="stylesheet"
/>
<link rel="shortcut icon" href="assets/brain.png" type="image/png" />
export default function Document() {
return (
<Html lang="en">
<Head>
<meta charSet="utf-8" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@200;300;400;600;800;900&display=swap"
rel="stylesheet"
/>
<link rel="shortcut icon" href="assets/brain.png" type="image/png" />

<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex/dist/katex.css"
crossOrigin="anonymous"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex/dist/katex.css"
crossOrigin="anonymous"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}

0 comments on commit fb20dd0

Please sign in to comment.