From 6ea099403a0d3659e2a0aeb3812c1e38c671e91a Mon Sep 17 00:00:00 2001 From: Benno Tielen Date: Wed, 12 Mar 2025 15:32:19 +0100 Subject: [PATCH] fix: image size --- src/app/(home)/gemeinde/[slug]/page.tsx | 5 +++-- src/utils/dto/blog.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/(home)/gemeinde/[slug]/page.tsx b/src/app/(home)/gemeinde/[slug]/page.tsx index 05eaf67..7fc5568 100644 --- a/src/app/(home)/gemeinde/[slug]/page.tsx +++ b/src/app/(home)/gemeinde/[slug]/page.tsx @@ -4,7 +4,7 @@ import { fetchEvents } from '@/fetch/events' import { fetchWorship } from '@/fetch/worship' import { fetchParish } from '@/fetch/parish' import { fetchLastAnnouncement } from '@/fetch/announcement' -import { transformGallery } from '@/utils/dto/gallery' +import { getPhoto, transformGallery } from '@/utils/dto/gallery' import { fetchLastCalendar } from '@/fetch/calendar' import { isAuthenticated } from '@/utils/auth' import { AdminMenu } from '@/components/AdminMenu/AdminMenu' @@ -35,12 +35,13 @@ export default async function ParishPage ({ params }: { params: Promise<{slug: s const announcement = await fetchLastAnnouncement(id); const calendar = await fetchLastCalendar(id); const authenticated = await isAuthenticated(); + const image = getPhoto("tablet", photo) return ( <> { return blog.map(b => { + const image = getPhoto("thumbnail", b.photo) return { id: b.id, title: b.title, href: `/blog/${b.id}`, - src: typeof b.photo === "string" ? b.photo : b.photo?.url || "" + src: typeof image === "object" ? image.src : "" } }) } \ No newline at end of file