_document.js 709 B

12345678910111213141516171819202122232425262728
  1. import Document, { Html, Head, Main, NextScript } from "next/document"
  2. import { getDirForLocale } from "../utils/locales"
  3. class MyDocument extends Document {
  4. static async getInitialProps(ctx) {
  5. const initialProps = await Document.getInitialProps(ctx)
  6. return { ...initialProps }
  7. }
  8. render() {
  9. const dir = getDirForLocale(this.props?.locale)
  10. return (
  11. <Html dir={dir}>
  12. <Head>
  13. <meta name="apple-itunes-app" content="app-id=1571998974" />
  14. <meta name="twitter:site" content="@joinmastodon" />
  15. </Head>
  16. <body className="bg-white">
  17. <Main />
  18. <NextScript />
  19. </body>
  20. </Html>
  21. )
  22. }
  23. }
  24. export default MyDocument