2021-02-09 09:33:54 +00:00
|
|
|
import Document, { Html, Head, Main, NextScript } from 'next/document';
|
2020-09-12 21:53:41 +00:00
|
|
|
import { ServerStyleSheet } from 'styled-components';
|
2020-09-09 21:09:51 +00:00
|
|
|
|
|
|
|
export default class MyDocument extends Document {
|
|
|
|
static async getInitialProps(ctx) {
|
2021-02-09 09:33:54 +00:00
|
|
|
const sheet = new ServerStyleSheet();
|
|
|
|
const originalRenderPage = ctx.renderPage;
|
2020-09-09 21:09:51 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
ctx.renderPage = () =>
|
|
|
|
originalRenderPage({
|
|
|
|
enhanceApp: (App) => (props) =>
|
|
|
|
sheet.collectStyles(<App {...props} />),
|
2021-02-09 09:33:54 +00:00
|
|
|
});
|
2020-09-09 21:09:51 +00:00
|
|
|
|
2021-02-09 09:33:54 +00:00
|
|
|
const initialProps = await Document.getInitialProps(ctx);
|
2020-09-09 21:09:51 +00:00
|
|
|
return {
|
|
|
|
...initialProps,
|
|
|
|
styles: (
|
|
|
|
<>
|
|
|
|
{initialProps.styles}
|
|
|
|
{sheet.getStyleElement()}
|
|
|
|
</>
|
|
|
|
),
|
2021-02-09 09:33:54 +00:00
|
|
|
};
|
2020-09-09 21:09:51 +00:00
|
|
|
} finally {
|
2021-02-09 09:33:54 +00:00
|
|
|
sheet.seal();
|
2020-09-09 21:09:51 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-13 06:30:07 +00:00
|
|
|
|
2020-09-09 21:09:51 +00:00
|
|
|
render() {
|
|
|
|
return (
|
2021-02-09 09:33:54 +00:00
|
|
|
<Html lang="en">
|
2020-09-09 21:09:51 +00:00
|
|
|
<Head>
|
2020-09-13 17:15:48 +00:00
|
|
|
<meta
|
|
|
|
name="description"
|
2021-02-15 09:24:15 +00:00
|
|
|
content="ente is a privacy focussed photo storage service that offers end-to-end encryption."
|
2020-09-13 17:15:48 +00:00
|
|
|
/>
|
2021-02-15 09:21:52 +00:00
|
|
|
<link rel="icon" href="/icon.svg" type="image/png" />
|
2021-05-23 14:25:48 +00:00
|
|
|
<link rel="manifest" href="manifest.json"></link>
|
2020-09-09 21:09:51 +00:00
|
|
|
</Head>
|
|
|
|
<body>
|
|
|
|
<Main />
|
|
|
|
<NextScript />
|
|
|
|
</body>
|
|
|
|
</Html>
|
|
|
|
);
|
|
|
|
}
|
2021-02-09 09:33:54 +00:00
|
|
|
}
|