add pigs to event categories, fallback to those
This commit is contained in:
@@ -6,6 +6,7 @@ import { EventHeader } from "@/components/events/EventHeader";
|
||||
import { BgPig } from "@/components/general/BgPig";
|
||||
import { graphql } from "@/gql";
|
||||
import { EventFragment } from "@/gql/graphql";
|
||||
import { getEventPig } from "@/lib/event";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
@@ -48,6 +49,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
||||
}
|
||||
|
||||
const event = (data?.event ?? {}) as EventFragment;
|
||||
const eventPig = getEventPig(event);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -60,7 +62,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
||||
<Blocks blocks={event.body} />
|
||||
</section>
|
||||
</main>
|
||||
{event.pig && <BgPig type={event.pig} color="white" />}
|
||||
{eventPig && <BgPig type={eventPig} color="white" />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user