feat: persist layout state across pages

This commit is contained in:
Jean-Philippe Sirois
2019-07-30 20:24:19 -04:00
parent a28452fbd7
commit 9d783afe87
11 changed files with 59 additions and 24 deletions
+18
View File
@@ -0,0 +1,18 @@
import React, { PropsWithChildren } from "react"
import { Layout } from "../components/Layout"
import { ResourcesLayout } from "../components/ResourcesLayout"
export default function BaseLayout({
children,
pageContext,
}: PropsWithChildren<{
pageContext: {
layout?: string
}
}>) {
if (pageContext.layout === "resources") {
return <ResourcesLayout>{children}</ResourcesLayout>
}
return <Layout>{children}</Layout>
}