import Head from "next/head"; import { useTheme } from "next-themes"; import classNames from "classnames"; import Header from "../Header/Header"; import Footer from "../Footer/Footer"; import themes from "../../lib/config/themes"; import styles from "./Layout.module.css"; export type LayoutProps = JSX.IntrinsicElements["div"] & { container?: boolean; // pass false to disable default `
` container styles with padding, etc. stickyHeader?: boolean; // pass false to override default stickiness of header when scrolling }; const Layout = ({ container = true, stickyHeader = true, className, children, ...rest }: LayoutProps) => { const { resolvedTheme } = useTheme(); return ( <> {/* dynamically set browser theme color to match the background color; default to light for SSR */}
{/* passing `container={false}` to Layout allows 100% control of the content area on a per-page basis */} {container ? (
{children}
) : ( <>{children} )}
); }; export default Layout;