show some featured images

This commit is contained in:
2024-05-10 16:20:19 +02:00
parent db8c88ffba
commit de0af201cc
11 changed files with 73 additions and 12 deletions

View File

@ -2,6 +2,7 @@ import { graphql } from "@/gql";
import { EventFragment } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { Blocks } from "@/components/blocks/Blocks";
import Image from "@/components/general/Image";
export async function generateStaticParams() {
const allEventSlugsQuery = graphql(`
@ -40,6 +41,15 @@ export default async function Page({ params }: { params: { slug: string } }) {
<main className="site-main" id="main">
<section className="page-header">
<h1>{event.title}</h1>
{event.featuredImage && (
<Image
src={event.featuredImage.url}
alt=""
width={event.featuredImage.width}
height={event.featuredImage.height}
sizes="100vw"
/>
)}
</section>
<section className="page-content">
<Blocks blocks={event.body} />

View File

@ -19,7 +19,9 @@ const EventFragmentDefinition = graphql(`
}
}
featuredImage {
src
url
width
height
}
facebookUrl
ticketUrl