Files
TheGame/packages/web/pages/_document.tsx
Hammad Jutt 0f9c790351 Setup Design System with NextJS Web App
Also replaced the local fonts with Google fonts since they are more performant and easier to package. Created a custom
Link component to render the ChakraUI link inside the NextJS Link properly.
2020-07-26 19:56:11 -06:00

40 lines
937 B
TypeScript

import GoogleFonts from 'next-google-fonts';
import Document, {
DocumentContext,
DocumentInitialProps,
Head,
Html,
Main,
NextScript,
} from 'next/document';
class MetaDocument extends Document {
static async getInitialProps(
ctx: DocumentContext,
): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}
render(): JSX.Element {
return (
<Html>
<GoogleFonts href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=IBM+Plex+Sans:wght@400;700&family=Press+Start+2P&display=swap" />
<Head>
<meta charSet="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MetaDocument;