1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-01-10 15:42:58 -05:00

don't set theme-color until we know for sure what the resolvedTheme is

This commit is contained in:
2022-01-08 11:32:43 -05:00
parent ce39750b0b
commit b7313985db
2 changed files with 11 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import Head from "next/head";
import { useTheme } from "next-themes";
import Header from "./page-header/Header";
import Footer from "./page-footer/Footer";
import { themeColorLight, themeColorDark } from "../lib/config";
import { themeColors } from "../lib/config";
import styles from "./Layout.module.css";
@@ -11,9 +11,11 @@ const Layout = ({ children }) => {
return (
<>
<Head>
<meta name="theme-color" content={resolvedTheme === "dark" ? themeColorDark : themeColorLight} />
</Head>
{resolvedTheme && (
<Head>
<meta name="theme-color" content={themeColors[resolvedTheme]} />
</Head>
)}
<Header />
<main className={styles.main}>