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

remove per-page getLayout option (maybe temporarily?)

This commit is contained in:
2022-04-19 17:38:20 -04:00
parent d5690d2972
commit d50ae0f85a
10 changed files with 228 additions and 314 deletions

View File

@ -28,12 +28,9 @@ const FlexedFooter = styled(Footer, {
flex: 1,
});
export type LayoutProps = ComponentProps<typeof Flex> & {
container?: boolean; // pass false to disable default `<main>` container styles with padding, etc.
stickyHeader?: boolean; // pass false to override default stickiness of header when scrolling
};
export type LayoutProps = ComponentProps<typeof Flex>;
const Layout = ({ container = true, stickyHeader = true, children, ...rest }: LayoutProps) => {
const Layout = ({ children, ...rest }: LayoutProps) => {
const { resolvedTheme } = useTheme();
return (
@ -44,16 +41,11 @@ const Layout = ({ container = true, stickyHeader = true, children, ...rest }: La
</Head>
<Flex {...rest}>
<Header sticky={stickyHeader} />
<Header />
{/* passing `container={false}` to Layout allows 100% control of the content area on a per-page basis */}
{container ? (
<Default>
<Container>{children}</Container>
</Default>
) : (
<>{children}</>
)}
<Default>
<Container>{children}</Container>
</Default>
<FlexedFooter />
</Flex>