add contact pages and blocks
This commit is contained in:
22
web/src/app/kontakt-test/page.tsx
Normal file
22
web/src/app/kontakt-test/page.tsx
Normal 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>
|
||||
);
|
||||
}
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user