From dadef81158972d28aa32812203500f77ed08a999 Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Thu, 22 Jan 2026 09:37:18 +0100 Subject: [PATCH 1/6] fix: event-specific custom CSS settings not being saved The ThemeCustomizerEnhanced component stored customCss in a separate local state that was never propagated to the parent component when hideActions was true (used in both CreateEventPage and EventDetailsPage). Changes: - handleChange() now includes customCss when propagating theme changes - CSS textarea onChange now propagates customCss to parent in preview mode - handlePresetSelect() clears customCss when selecting a preset Fixes #136 --- .../admin/ThemeCustomizerEnhanced.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/admin/ThemeCustomizerEnhanced.tsx b/frontend/src/components/admin/ThemeCustomizerEnhanced.tsx index fffb70d5..df1df102 100644 --- a/frontend/src/components/admin/ThemeCustomizerEnhanced.tsx +++ b/frontend/src/components/admin/ThemeCustomizerEnhanced.tsx @@ -67,15 +67,16 @@ export const ThemeCustomizerEnhanced: React.FC = ( const handleChange = (key: keyof ThemeConfig, newValue: any) => { const updated = { ...localTheme, [key]: newValue }; setLocalTheme(updated); - + // When any change is made, mark it as custom if (selectedPreset !== 'custom' && onPresetChange) { setSelectedPreset('custom'); onPresetChange('custom'); } - + if (isPreviewMode) { - onChange(updated); + // Include customCss in the propagated theme + onChange({ ...updated, customCss }); } }; @@ -84,6 +85,7 @@ export const ThemeCustomizerEnhanced: React.FC = ( if (preset) { setSelectedPreset(presetKey); setLocalTheme(preset.config); + setCustomCss(''); // Clear custom CSS when selecting a preset if (onPresetChange) { onPresetChange(presetKey); } @@ -722,12 +724,17 @@ export const ThemeCustomizerEnhanced: React.FC = (