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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user