mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-12-03 22:58:57 -05:00
next-mdx-remote v4 (#737)
This commit is contained in:
18
components/Layout/Layout.module.css
Normal file
18
components/Layout/Layout.module.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.main {
|
||||
width: 100%;
|
||||
padding: 1.5em;
|
||||
color: var(--text);
|
||||
background-color: var(--background-inner);
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 865px;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.main {
|
||||
padding: 1.25em;
|
||||
}
|
||||
}
|
||||
34
components/Layout/Layout.tsx
Normal file
34
components/Layout/Layout.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import Head from "next/head";
|
||||
import { useTheme } from "next-themes";
|
||||
import Header from "../Header/Header";
|
||||
import Footer from "../Footer/Footer";
|
||||
import { themeColors } from "../../lib/config";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import styles from "./Layout.module.css";
|
||||
|
||||
type Props = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
const Layout = ({ children }: Props) => {
|
||||
const { resolvedTheme } = useTheme();
|
||||
|
||||
return (
|
||||
<>
|
||||
{resolvedTheme && (
|
||||
<Head>
|
||||
<meta name="theme-color" content={themeColors[resolvedTheme]} />
|
||||
</Head>
|
||||
)}
|
||||
|
||||
<Header />
|
||||
<main className={styles.main}>
|
||||
<div className={styles.container}>{children}</div>
|
||||
</main>
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Layout;
|
||||
Reference in New Issue
Block a user