1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 22:26:38 -04:00

add support for per-page layouts

This commit is contained in:
2022-02-04 16:14:42 -05:00
parent 0127004e3a
commit 41705f3be4
7 changed files with 139 additions and 134 deletions

View File

@ -9,10 +9,11 @@ import type { PropsWithChildren } from "react";
import styles from "./Layout.module.css";
type Props = PropsWithChildren<{
noContainer?: boolean; // pass true to disable default `<main>` container styles with padding, etc.
className?: string;
}>;
const Layout = ({ className, children }: Props) => {
const Layout = ({ noContainer, className, children }: Props) => {
const { resolvedTheme } = useTheme();
return (
@ -24,9 +25,15 @@ const Layout = ({ className, children }: Props) => {
)}
<Header />
<main className={classNames(styles.main, className)}>
<div className={styles.container}>{children}</div>
</main>
{noContainer ? (
<main className={className}>{children}</main>
) : (
<main className={classNames(styles.main, className)}>
<div className={styles.container}>{children}</div>
</main>
)}
<Footer />
</>
);