Skip to content

Commit

Permalink
Merge pull request #14 from SocialGouv/favicon
Browse files Browse the repository at this point in the history
Add favicon.
  • Loading branch information
Julien Bouquillon authored Nov 30, 2020
2 parents b462026 + 705e982 commit ddafc3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React from "react";
import Document, { Head, Html, Main, NextScript } from "next/document";
import { ServerStyleSheet } from "styled-components";
import React from "react"
import Document, { Head, Html, Main, NextScript } from "next/document"
import { ServerStyleSheet } from "styled-components"

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
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);
const initialProps = await Document.getInitialProps(ctx)
return {
...initialProps,
styles: (
Expand All @@ -23,20 +23,22 @@ export default class MyDocument extends Document {
{sheet.getStyleElement()}
</>
),
};
}
} finally {
sheet.seal();
sheet.seal()
}
}
render() {
return (
<Html lang="fr">
<Head />
<Head>
<link rel="shortcut icon" href="/img/favicon.png" />
</Head>
<body id="page-top">
<Main />
<NextScript />
</body>
</Html>
);
)
}
}
Binary file added public/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ddafc3a

Please sign in to comment.