From 417bbd430ed95c7abedbd14df5221e8285ccda09 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 1 Aug 2026 21:41:23 +0000 Subject: [PATCH] Add product image gallery, harden Klaro border reset, remove attribution link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ProductGallery.tsx (main image + thumbnail strip) wired into TodoKartenHero.tsx, only replacing the static hero photo once a product actually has extra gallery photos — no visual change otherwise. Backend field: Products.gallery (see payload repo). Klaro's hard black border was still showing after the previous color-only pass — the targeted border:none rule wasn't enough, so this blanket-resets border/outline on every .klaro descendant and re-adds only the shadow this theme actually wants. Also disables the "Realisiert mit Klaro!" attribution link (BSD-3-Clause has no on-page-attribution requirement, Klaro's own disablePoweredBy flag covers this cleanly). Updates the frontend README with the gallery + Klaro fixes. Co-Authored-By: Claude Sonnet 5 --- README.md | 20 +++++ app/components/KlaroConsentManager.tsx | 9 ++- app/components/ProductGallery.tsx | 81 ++++++++++++++++++++ app/lib/__tests__/cartTotals.test.ts | 1 + app/lib/klaroConfig.ts | 6 ++ app/lib/payload.ts | 9 +++ app/todo-cards/components/TodoKartenHero.tsx | 41 ++++++---- 7 files changed, 151 insertions(+), 16 deletions(-) create mode 100644 app/components/ProductGallery.tsx diff --git a/README.md b/README.md index a71e699..4842263 100644 --- a/README.md +++ b/README.md @@ -1854,6 +1854,26 @@ has its own dedicated Live Preview renderer, not the shared generic order-status one — there's no order for this email type, so no fake "Bestellnummer" line; CTA is "Zum Produkt", not "Bestellung ansehen". +## Product image gallery + +`ProductGallery.tsx` — main image + thumbnail strip, swappable on click, +backed by an optional `Products.gallery` field (backend, `hasMany` upload, +empty for most products — see the Payload README). Renders as a single +plain image with no thumbnail row at all when `gallery` is empty, i.e. the +same appearance every product already had before this existed — a product +only gets the gallery UI once someone deliberately adds extra photos in +the admin. + +There's no generic `/shop/[slug]` product detail page in this app — every +product beyond the plain grid card gets a bespoke hero page (currently +just `/todo-cards`), matching the custom-per-client site model. +`ProductGallery` is wired into `TodoKartenHero.tsx` as a drop-in +replacement for that page's static hero photo — but only once +`product.gallery.length > 0`; otherwise the curated static lifestyle +photo (`/hero-todo-karten.png`, deliberately not just the catalog image) +stays exactly as it was. A future bespoke product page can reuse the same +component the same way. + ## Tests `npm run test:unit` (Vitest, `node` environment, no jsdom/Next.js runtime diff --git a/app/components/KlaroConsentManager.tsx b/app/components/KlaroConsentManager.tsx index af80227..c056ff6 100644 --- a/app/components/KlaroConsentManager.tsx +++ b/app/components/KlaroConsentManager.tsx @@ -38,9 +38,14 @@ import { loadTrackingCode } from "../lib/loadTrackingCode"; function KlaroTheme() { return (