From 2fe1187abde3a30bec7dbad5e34ad51b41b1366b Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Tue, 17 Nov 2026 13:18:13 +0100 Subject: [PATCH] Hero: themagebonden Checkbox/Radio in het Hero-scherm en de focusdialoog; zoomschuif met themakleur Co-Authored-By: Claude Sonnet 5.5 --- .../features/hero/components/FocusDialog.tsx | 37 +++++++++---------- frontend/src/features/hero/pages/HeroPage.tsx | 12 ++---- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/frontend/src/features/hero/components/FocusDialog.tsx b/frontend/src/features/hero/components/FocusDialog.tsx index fdca308..2c47ab8 100644 --- a/frontend/src/features/hero/components/FocusDialog.tsx +++ b/frontend/src/features/hero/components/FocusDialog.tsx @@ -2,6 +2,8 @@ import { useRef, useState, type KeyboardEvent, type PointerEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; +import { CheckboxField } from '@/components/ui/checkbox'; +import { RadioField } from '@/components/ui/radio'; import { Label } from '@/components/ui/label'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { mediaUrl } from '../lib/media'; @@ -101,29 +103,24 @@ function FocusEditor({ image, onApply, onClose }: { image: HeroImageDto; onApply
{t('hero.focus.targetLegend')} {(['general', 'wide', 'tall'] as const).map((value) => ( - + setTarget(value)} + data-testid={`focus-target-${value}`} + label={t(`hero.focus.target.${value}`)} + /> ))}
{target !== 'general' && ( - + toggleOverride(event.target.checked)} + data-testid={`focus-override-${target}`} + label={t('hero.focus.override')} + /> )}
@@ -205,7 +202,7 @@ function FocusEditor({ image, onApply, onClose }: { image: HeroImageDto; onApply disabled={!editable} value={active.zoom} onChange={(event) => update({ ...active, zoom: Number(event.target.value) })} - className="w-full" + className="w-full accent-primary disabled:cursor-not-allowed disabled:opacity-50" data-testid="focus-zoom" />
diff --git a/frontend/src/features/hero/pages/HeroPage.tsx b/frontend/src/features/hero/pages/HeroPage.tsx index b81943a..596d626 100644 --- a/frontend/src/features/hero/pages/HeroPage.tsx +++ b/frontend/src/features/hero/pages/HeroPage.tsx @@ -10,6 +10,8 @@ import { SortableContext, sortableKeyboardCoordinates, verticalListSortingStrate import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; +import { CheckboxField } from '@/components/ui/checkbox'; +import { RadioField } from '@/components/ui/radio'; import { Label } from '@/components/ui/label'; import { FieldError } from '@/components/ui/FieldError'; import { FormErrorBanner } from '@/components/ui/FormErrorBanner'; @@ -431,10 +433,7 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) { {t('hero.fields.display')}
{(['single', 'slideshow'] as const).map((value) => ( - + ))}
@@ -548,10 +547,7 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) {

{t('hero.slides.altHint')}

- +