allow generic pages to have pigs

This commit is contained in:
2024-08-09 20:08:12 +02:00
parent 3d3d991fa7
commit 9d78cf2822
6 changed files with 63 additions and 10 deletions

View File

@ -4,6 +4,7 @@ import { getClient } from "@/app/client";
import { notFound } from "next/navigation";
import { PageHeader } from "@/components/general/PageHeader";
import { PageContent } from "@/components/general/PageContent";
import { BgPig } from "@/components/general/BgPig";
export const dynamicParams = false;
@ -14,6 +15,7 @@ const GenericFragmentDefinition = graphql(`
urlPath
title
lead
pig
body {
...Blocks
}
@ -74,9 +76,12 @@ export default async function Page({ params }: { params: { url: string[] } }) {
}
return (
<main className="site-main" id="main">
<PageHeader heading={page.title} lead={page.lead} />
<PageContent blocks={page.body} />
</main>
<>
<main className="site-main" id="main">
<PageHeader heading={page.title} lead={page.lead} />
<PageContent blocks={page.body} />
</main>
{page.pig && <BgPig type={page.pig} color="white" />}
</>
);
}