thunderhub/pages/_document.tsx
Anthony Potdevin f985e51b98
feat: add leaderboard (#119)
* feat:  add leaderboard

* chore: 🔧 add leaderboard

* chore: 🔧 leaderboard card

* style: 🎨 node card

* chore: 🔧 cleanup

* chore: 🔧 remove ssr query
2020-08-09 23:16:44 +02:00

58 lines
1.3 KiB
TypeScript

import * as React from 'react';
import Document, {
DocumentContext,
Html,
Head,
Main,
NextScript,
} from 'next/document';
import { ServerStyleSheet } from 'styled-components';
export default class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: App => props => sheet.collectStyles(<App {...props} />),
});
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
),
};
} finally {
sheet.seal();
}
}
render() {
return (
<Html>
<Head>
<meta
name="description"
content="Manage and monitor your lightning network node right inside your browser"
key="description"
/>
<link
href="https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&display=swap"
rel="stylesheet"
></link>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}