From 026c2bc11deac6f9488c8ab81abf389020b16adc Mon Sep 17 00:00:00 2001 From: Anna Hughes Date: Mon, 6 Nov 2023 11:47:47 +0000 Subject: [PATCH] fix hotjar NPS stylesheet import(#219) --- src/components/Head.js | 1 - src/pages/_document.js | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/Head.js b/src/components/Head.js index 4dd0b245..9f14766c 100644 --- a/src/components/Head.js +++ b/src/components/Head.js @@ -7,7 +7,6 @@ const Head = ({ title, description, ogDescription, ogImage, ogTitle, ogImageAlt {title} | YSM - diff --git a/src/pages/_document.js b/src/pages/_document.js index f1acdc54..56c898bd 100644 --- a/src/pages/_document.js +++ b/src/pages/_document.js @@ -1,8 +1,6 @@ /* eslint-disable react/jsx-filename-extension */ import { ServerStyleSheets } from '@material-ui/core/styles'; -import Document, { - Head, Html, Main, NextScript, -} from 'next/document'; +import Document, { Head, Html, Main, NextScript } from 'next/document'; import React from 'react'; export default class MyDocument extends Document { @@ -10,7 +8,11 @@ export default class MyDocument extends Document { return ( - + +
@@ -25,9 +27,10 @@ MyDocument.getInitialProps = async (ctx) => { const sheets = new ServerStyleSheets(); const originalRenderPage = ctx.renderPage; - ctx.renderPage = () => originalRenderPage({ - enhanceApp: (App) => (props) => sheets.collect(), - }); + ctx.renderPage = () => + originalRenderPage({ + enhanceApp: (App) => (props) => sheets.collect(), + }); const initialProps = await Document.getInitialProps(ctx);