1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-30 07:36:02 -04:00

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

View File

@@ -1,16 +1,26 @@
import Head from "next/head";
import { useTheme } from "next-themes";
import Header from "./page-header/Header";
import Footer from "./page-footer/Footer";
import styles from "./Layout.module.css";
const Layout = ({ children }) => (
<>
<Header />
<main className={styles.main}>
<div className={styles.container}>{children}</div>
</main>
<Footer />
</>
);
const Layout = ({ children }) => {
const { resolvedTheme } = useTheme();
return (
<>
<Head>
<meta name="theme-color" content={resolvedTheme === "dark" ? "#252525" : "#fcfcfc"} />
</Head>
<Header />
<main className={styles.main}>
<div className={styles.container}>{children}</div>
</main>
<Footer />
</>
);
};
export default Layout;

View File

@@ -1,3 +1,4 @@
import { memo } from "react";
import Link from "next/link";
import { HeartIcon, NextjsIcon } from "../icons";
import * as config from "../../lib/config";
@@ -48,4 +49,4 @@ const Footer = () => (
</footer>
);
export default Footer;
export default memo(Footer);

View File

@@ -1,3 +1,4 @@
import { memo } from "react";
import Name from "./Name";
import Menu from "./Menu";
@@ -12,4 +13,4 @@ const Header = () => (
</header>
);
export default Header;
export default memo(Header);

View File

@@ -1,3 +1,4 @@
import { memo } from "react";
import { useTheme } from "next-themes";
import { BulbOffIcon, BulbOnIcon } from "../icons";
@@ -25,4 +26,4 @@ const ThemeToggle = ({ className = "" }) => {
);
};
export default ThemeToggle;
export default memo(ThemeToggle);