Offerings: banner-tabblad in de admin (lijst, formulier, planning), layout uit de frontend; gate-test bijgewerkt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,6 @@ export function OfferingForm({ initialValues, onSubmit, isSubmitting }: Offering
|
||||
featured: false,
|
||||
slug: '',
|
||||
categoryId: null,
|
||||
layout: 'card',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -51,7 +50,6 @@ export function OfferingForm({ initialValues, onSubmit, isSubmitting }: Offering
|
||||
const NO_CATEGORY = 'none';
|
||||
const { data: categories, isFetching: isFetchingCategories } = useOfferingCategories();
|
||||
const categoryId = useWatch({ control, name: 'categoryId' });
|
||||
const layout = useWatch({ control, name: 'layout' });
|
||||
const selectedCategory =
|
||||
categoryId != null && categories?.some((c) => c.id === categoryId) ? categoryId : NO_CATEGORY;
|
||||
|
||||
@@ -293,24 +291,6 @@ export function OfferingForm({ initialValues, onSubmit, isSubmitting }: Offering
|
||||
<Label htmlFor="offering-featured">{t('offerings.form.featuredLabel')}</Label>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="offering-layout">{t('offerings.form.layoutLabel')}</Label>
|
||||
<select
|
||||
id="offering-layout"
|
||||
data-testid="offering-layout"
|
||||
className="h-11 w-full rounded-md border border-input bg-background px-3 text-sm"
|
||||
{...register('layout')}
|
||||
>
|
||||
<option value="card">{t('offerings.form.layoutCard')}</option>
|
||||
<option value="banner">{t('offerings.form.layoutBanner')}</option>
|
||||
</select>
|
||||
{layout === 'banner' && (
|
||||
<p className="text-sm text-muted-foreground" data-testid="offering-layout-banner-hint">
|
||||
{t('offerings.form.layoutBannerHint')}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Button type="submit" disabled={isSubmitting} data-testid="offering-form-submit">
|
||||
{isSubmitting ? '…' : t('offerings.form.submitButton')}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user