1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 02:15:47 -04:00

prevent fading into dark theme if we're immediately setting it on load

This commit is contained in:
2022-02-06 12:25:48 -05:00
parent 4e7f235ed5
commit ee1b708b99
16 changed files with 50 additions and 35 deletions

View File

@@ -68,6 +68,8 @@ const App = ({ Component, pageProps }: Props) => {
return (
<>
<ThemeProvider>{getLayout(<Component {...pageProps} />)}</ThemeProvider>
{/* all SEO config is in ./lib/seo.ts except for canonical URLs, which require access to next router */}
<DefaultSeo
{...defaultSeo}
@@ -81,8 +83,6 @@ const App = ({ Component, pageProps }: Props) => {
dangerouslySetAllPagesToNoFollow={process.env.NEXT_PUBLIC_VERCEL_ENV !== "production"}
/>
<SocialProfileJsonLd {...socialProfileJsonLd} />
<ThemeProvider>{getLayout(<Component {...pageProps} />)}</ThemeProvider>
</>
);
};

View File

@@ -1,4 +1,5 @@
import Document, { Html, Head, Main, NextScript } from "next/document";
import classNames from "classnames";
import * as config from "../lib/config";
import type { DocumentContext } from "next/document";
@@ -13,7 +14,7 @@ class MyDocument extends Document {
return (
<Html lang={config.siteLocale?.replace("_", "-")}>
<Head />
<body>
<body className={classNames("page", "loading")}>
<Main />
<NextScript />
</body>