add support for page sections on generic pages

This commit is contained in:
2024-06-21 23:13:15 +02:00
parent 82f451cb14
commit 41f5297a12
16 changed files with 683 additions and 93 deletions

View File

@@ -3,6 +3,7 @@ import { GenericFragment } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { Blocks } from "@/components/blocks/Blocks";
import { notFound } from "next/navigation";
import { PageHeader } from "@/components/general/PageHeader";
export const dynamicParams = false;
@@ -12,6 +13,7 @@ const GenericFragmentDefinition = graphql(`
id
urlPath
title
lead
body {
...Blocks
}
@@ -70,12 +72,13 @@ export default async function Page({ params }: { params: { url: string[] } }) {
if (!page) {
return notFound();
}
return (
<main className="site-main" id="main">
<section className="page-header">
<h1>{page.title}</h1>
</section>
<PageHeader
heading={page.title}
lead={page.lead}
/>
<Blocks blocks={page.body} />
</main>
);

View File

@@ -4,7 +4,7 @@ import { getClient } from "@/app/client";
import Link from "next/link";
import { PageHeader } from "@/components/general/PageHeader";
import { IconListBlock } from "@/components/blocks/IconListBlock";
import { PageSection } from "@/components/blocks/PageSection";
import { PageSectionBlock } from "@/components/blocks/PageSection";
export default async function Page() {
return (
@@ -61,12 +61,11 @@ export default async function Page() {
</li>
</ul>
</div>
<PageSection
heading="Adkomst"
subheading="Hvordan kommer man seg til Neuf?"
<PageSectionBlock
block={{ title: "Adkomst" } as any}
// subheading="Hvordan kommer man seg til Neuf?"
/>
<PageSection heading="Åpningstider" />
<PageSection />
<PageSectionBlock block={{ title: "Åpningstider" } as any} />
<section className="pageSection" id="adkomst">
<h1>Adkomst</h1>
<div className="pageSectionGroup">