Files
pawol.nu/pages/_document.js
T

44 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-12-04 20:16:24 +01:00
import React from 'react'
import Document, {
Html, Head, Main, NextScript
} from 'next/document'
2022-01-19 07:06:26 +04:00
import ServerStyleSheets from '@mui/styles/ServerStyleSheets'
2020-12-04 20:16:24 +01:00
export default class MyDocument extends Document {
render() {
return (
<Html lang='fr' prefix='website: https://ogp.me/ns/website#'>
2022-01-09 21:47:11 +04:00
<Head>
<link rel='manifest' href='/manifest.json' />
<link rel='icon' type='image/x-icon' sizes='128x128' href='/favicon.ico' />
<link rel='apple-touch-icon' href='/favicon.ico' />
<meta name='application-name' content='#OKi | Organisation KA Internationale' />
<meta name='theme-color' content='#303030' />
<meta name='apple-mobile-web-app-status-bar' content='#303030' />
<meta charSet='utf-8' />
</Head>
2020-12-04 20:16:24 +01:00
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
MyDocument.getInitialProps = async ctx => {
const sheets = new ServerStyleSheets()
const originalRenderPage = ctx.renderPage
ctx.renderPage = () => originalRenderPage({
enhanceApp: App => props => sheets.collect(<App {...props} />)
})
const initialProps = await Document.getInitialProps(ctx)
return {
...initialProps,
styles: [...React.Children.toArray(initialProps.styles), sheets.getStyleElement()]
}
}