_document.page.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* eslint-disable @next/next/google-font-display */
  2. import React from 'react';
  3. import Document, {
  4. DocumentContext, DocumentInitialProps,
  5. Html, Head, Main, NextScript,
  6. } from 'next/document';
  7. // type GrowiDocumentProps = {};
  8. // declare type GrowiDocumentInitialProps = GrowiDocumentProps & DocumentInitialProps;
  9. declare type GrowiDocumentInitialProps = DocumentInitialProps;
  10. class GrowiDocument extends Document {
  11. static override async getInitialProps(ctx: DocumentContext): Promise<GrowiDocumentInitialProps> {
  12. const initialProps: DocumentInitialProps = await Document.getInitialProps(ctx);
  13. return initialProps;
  14. }
  15. override render(): JSX.Element {
  16. return (
  17. <Html>
  18. <Head>
  19. {/*
  20. {renderScriptTagsByGroup('basis')}
  21. {renderStyleTagsByGroup('basis')}
  22. */}
  23. <link rel='preload' href="/static/fonts/PressStart2P-latin.woff2" as="font" type="font/woff2" />
  24. <link rel='preload' href="/static/fonts/PressStart2P-latin-ext.woff2" as="font" type="font/woff2" />
  25. <link rel='preload' href="/static/fonts/Lato-Regular-latin.woff2" as="font" type="font/woff2" />
  26. <link rel='preload' href="/static/fonts/Lato-Regular-latin-ext.woff2" as="font" type="font/woff2" />
  27. <link rel='preload' href="/static/fonts/Lato-Bold-latin.woff2" as="font" type="font/woff2" />
  28. <link rel='preload' href="/static/fonts/Lato-Bold-latin-ext.woff2" as="font" type="font/woff2" />
  29. </Head>
  30. <body>
  31. <Main />
  32. <NextScript />
  33. </body>
  34. </Html>
  35. );
  36. }
  37. }
  38. export default GrowiDocument;