web: fetch some content
This commit is contained in:
39
web/src/app/arrangementer/page.tsx
Normal file
39
web/src/app/arrangementer/page.tsx
Normal file
@ -0,0 +1,39 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import { getClient } from "@/app/client";
|
||||
|
||||
export default async function Page() {
|
||||
const query = gql(`
|
||||
{
|
||||
pages(contentType: "events.EventPage") {
|
||||
id
|
||||
slug
|
||||
title
|
||||
... on EventPage {
|
||||
body {
|
||||
id
|
||||
blockType
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
const { data } = await getClient().query({
|
||||
query: query,
|
||||
});
|
||||
|
||||
return (
|
||||
<main className="site-main" id="main">
|
||||
<section className="page-header textOnly">
|
||||
<h1>Arrangementer</h1>
|
||||
<p>woo</p>
|
||||
</section>
|
||||
{data.pages && (
|
||||
<section className="page-content">
|
||||
{data.pages.map((event) => (
|
||||
<div key={event.id}>{event.title}</div>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user