From 17375ef87689b30e9bb7290aabf6aacd78f527a1 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Thu, 6 Jan 2022 19:58:07 -0500 Subject: [PATCH] static header and footer were being re-rendered on every route change --- components/Container.module.scss | 5 - components/Container.tsx | 26 - components/Layout.module.scss | 6 + components/Layout.tsx | 25 +- components/page-header/ThemeToggle.tsx | 5 +- pages/_app.tsx | 4 + pages/birthday.tsx | 63 +- pages/cli.tsx | 145 +- pages/contact.tsx | 93 +- pages/hillary.tsx | 123 +- pages/index.tsx | 627 ++++--- pages/leo.tsx | 123 +- pages/license.tsx | 892 +++++----- pages/notes/[slug].tsx | 15 +- pages/notes/index.tsx | 7 +- pages/previously.tsx | 329 ++-- pages/privacy.tsx | 385 +++-- pages/projects.tsx | 85 +- pages/uses.tsx | 2129 ++++++++++++------------ 19 files changed, 2515 insertions(+), 2572 deletions(-) delete mode 100644 components/Container.module.scss delete mode 100644 components/Container.tsx diff --git a/components/Container.module.scss b/components/Container.module.scss deleted file mode 100644 index 5ba405eb..00000000 --- a/components/Container.module.scss +++ /dev/null @@ -1,5 +0,0 @@ -.container { - max-width: 865px; - margin: 0 auto; - display: block; -} diff --git a/components/Container.tsx b/components/Container.tsx deleted file mode 100644 index 354b0dcb..00000000 --- a/components/Container.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { NextSeo } from "next-seo"; - -import styles from "./Container.module.scss"; - -type Props = { - title?: string; - description?: string; - children: unknown; -}; - -const Container = ({ title, description, children }: Props) => { - return ( - <> - -
{children}
- - ); -}; - -export default Container; diff --git a/components/Layout.module.scss b/components/Layout.module.scss index 4b162729..23c032fa 100644 --- a/components/Layout.module.scss +++ b/components/Layout.module.scss @@ -5,6 +5,12 @@ background-color: var(--background-inner); } +.container { + max-width: 865px; + margin: 0 auto; + display: block; +} + @media screen and (max-width: 768px) { .main { padding: 1.25em; diff --git a/components/Layout.tsx b/components/Layout.tsx index a31bd410..106f3387 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -1,13 +1,26 @@ -import Header from "./page-header/Header"; -import Footer from "./page-footer/Footer"; +import { NextSeo } from "next-seo"; import styles from "./Layout.module.scss"; -const Layout = ({ children }) => ( +type Props = { + title?: string; + description?: string; + children: unknown; +}; + +const Layout = ({ title, description, children }: Props) => ( <> -
-
{children}
-