re-add <meta name="theme-color" ...> tag

This commit is contained in:
2022-01-07 17:19:12 -05:00
parent 41d2b8c64b
commit a1fd5cd940
4 changed files with 25 additions and 12 deletions
+11 -1
View File
@@ -1,10 +1,19 @@
import Head from "next/head";
import { useTheme } from "next-themes";
import Header from "./page-header/Header"; import Header from "./page-header/Header";
import Footer from "./page-footer/Footer"; import Footer from "./page-footer/Footer";
import styles from "./Layout.module.css"; import styles from "./Layout.module.css";
const Layout = ({ children }) => ( const Layout = ({ children }) => {
const { resolvedTheme } = useTheme();
return (
<> <>
<Head>
<meta name="theme-color" content={resolvedTheme === "dark" ? "#252525" : "#fcfcfc"} />
</Head>
<Header /> <Header />
<main className={styles.main}> <main className={styles.main}>
<div className={styles.container}>{children}</div> <div className={styles.container}>{children}</div>
@@ -12,5 +21,6 @@ const Layout = ({ children }) => (
<Footer /> <Footer />
</> </>
); );
};
export default Layout; export default Layout;
+2 -1
View File
@@ -1,3 +1,4 @@
import { memo } from "react";
import Link from "next/link"; import Link from "next/link";
import { HeartIcon, NextjsIcon } from "../icons"; import { HeartIcon, NextjsIcon } from "../icons";
import * as config from "../../lib/config"; import * as config from "../../lib/config";
@@ -48,4 +49,4 @@ const Footer = () => (
</footer> </footer>
); );
export default Footer; export default memo(Footer);
+2 -1
View File
@@ -1,3 +1,4 @@
import { memo } from "react";
import Name from "./Name"; import Name from "./Name";
import Menu from "./Menu"; import Menu from "./Menu";
@@ -12,4 +13,4 @@ const Header = () => (
</header> </header>
); );
export default Header; export default memo(Header);
+2 -1
View File
@@ -1,3 +1,4 @@
import { memo } from "react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import { BulbOffIcon, BulbOnIcon } from "../icons"; import { BulbOffIcon, BulbOnIcon } from "../icons";
@@ -25,4 +26,4 @@ const ThemeToggle = ({ className = "" }) => {
); );
}; };
export default ThemeToggle; export default memo(ThemeToggle);