add contact pages and blocks

This commit is contained in:
2024-06-24 05:11:55 +02:00
parent 944506cc2f
commit 15e4e70806
30 changed files with 1448 additions and 51 deletions

View File

@ -0,0 +1,22 @@
import { graphql } from "@/gql";
//import { NewsFragment } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { NewsList } from "@/components/news/NewsList";
import Link from "next/link";
import { PageHeader } from "@/components/general/PageHeader";
import { PersonSection } from "@/components/people/PersonSection";
import { ContactInfo } from "@/components/contact/ContactInfo";
export default async function Page() {
return (
<main className="site-main" id="main">
<PageHeader
heading="Kontakt"
lead="Her er info om hvordan du kan kontakte oss og sånt."
/>
<ContactInfo />
<PersonSection heading="Styret" />
<PersonSection heading="Administrasjonen" />
</main>
);
}

View File

@ -1,22 +1,40 @@
import { graphql } from "@/gql";
//import { NewsFragment } from "@/gql/graphql";
import { ContactFragment, ContactIndexFragment } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { NewsList } from "@/components/news/NewsList";
import { ContactList } from "@/components/Contacts/ContactList";
import { Blocks } from "@/components/blocks/Blocks";
import Link from "next/link";
import { PageHeader } from "@/components/general/PageHeader";
import { PersonSection } from "@/components/people/PersonSection";
import { ContactInfo } from "@/components/contact/ContactInfo";
const ContactIndexDefinition = graphql(`
fragment ContactIndex on ContactIndex {
... on ContactIndex {
title
lead
body {
...Blocks
}
}
}
`);
export default async function Page() {
const contactQuery = graphql(`
query contacts {
contactIndex {
... on ContactIndex {
...ContactIndex
}
}
}
`);
const { data, error } = await getClient().query(contactQuery, {});
const index = (data?.contactIndex ?? []) as ContactIndexFragment;
return (
<main className="site-main" id="main">
<PageHeader
heading="Kontakt"
lead="Her er info om hvordan du kan kontakte oss og sånt."
/>
<ContactInfo />
<PersonSection heading="Styret" />
<PersonSection heading="Administrasjonen" />
<PageHeader heading={index.title} lead={index.lead} />
{index.body && <Blocks blocks={index.body} />}
</main>
);
}