From bf0a43384beaee88438c66ac182a4281318b5cc4 Mon Sep 17 00:00:00 2001 From: PEDZEO Date: Wed, 21 Jan 2026 02:04:48 +0300 Subject: [PATCH] Add collapsible theme sections and Russian translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Translated Quick Presets to Russian (Быстрые пресеты) - Translated preset names: Стандарт, Океан, Лес, Закат, Фиолет, Роза, Полночь, Бирюза - Made theme color sections collapsible (Accent, Dark Theme, Light Theme, Status Colors) - Each section shows color preview when collapsed --- src/pages/AdminSettings.tsx | 267 +++++++++++++++++++++++------------- 1 file changed, 168 insertions(+), 99 deletions(-) diff --git a/src/pages/AdminSettings.tsx b/src/pages/AdminSettings.tsx index f945a3c..c640336 100644 --- a/src/pages/AdminSettings.tsx +++ b/src/pages/AdminSettings.tsx @@ -134,11 +134,11 @@ const META_CATEGORIES: Record>(new Set()) const fileInputRef = useRef(null) + const toggleThemeSection = (section: string) => { + setExpandedThemeSections(prev => { + const next = new Set(prev) + if (next.has(section)) { + next.delete(section) + } else { + next.add(section) + } + return next + }) + } + // Branding query and mutations const { data: branding } = useQuery({ queryKey: ['branding'], @@ -1485,7 +1498,7 @@ export default function AdminSettings() { {/* Quick Presets */}
- +
{THEME_PRESETS.map((preset) => (
- {/* Accent Color */} - updateColorsMutation.mutate({ accent: color })} - disabled={updateColorsMutation.isPending} - /> - - {/* Dark Theme Section */} -
-

{t('theme.darkTheme')}

-
- updateColorsMutation.mutate({ darkBackground: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ darkSurface: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ darkText: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ darkTextSecondary: color })} - disabled={updateColorsMutation.isPending} - /> -
+ {/* Accent Color - Collapsible */} +
+ + {expandedThemeSections.has('accent') && ( +
+ updateColorsMutation.mutate({ accent: color })} + disabled={updateColorsMutation.isPending} + /> +
+ )}
- {/* Light Theme Section */} -
-

{t('theme.lightTheme')}

-
- updateColorsMutation.mutate({ lightBackground: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ lightSurface: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ lightText: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ lightTextSecondary: color })} - disabled={updateColorsMutation.isPending} - /> -
+ {/* Dark Theme Section - Collapsible */} +
+ + {expandedThemeSections.has('dark') && ( +
+ updateColorsMutation.mutate({ darkBackground: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ darkSurface: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ darkText: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ darkTextSecondary: color })} + disabled={updateColorsMutation.isPending} + /> +
+ )}
- {/* Status Colors */} -
-

{t('theme.statusColors')}

-
- updateColorsMutation.mutate({ success: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ warning: color })} - disabled={updateColorsMutation.isPending} - /> - updateColorsMutation.mutate({ error: color })} - disabled={updateColorsMutation.isPending} - /> -
+ {/* Light Theme Section - Collapsible */} +
+ + {expandedThemeSections.has('light') && ( +
+ updateColorsMutation.mutate({ lightBackground: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ lightSurface: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ lightText: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ lightTextSecondary: color })} + disabled={updateColorsMutation.isPending} + /> +
+ )} +
+ + {/* Status Colors - Collapsible */} +
+ + {expandedThemeSections.has('status') && ( +
+ updateColorsMutation.mutate({ success: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ warning: color })} + disabled={updateColorsMutation.isPending} + /> + updateColorsMutation.mutate({ error: color })} + disabled={updateColorsMutation.isPending} + /> +
+ )}
{/* Preview */}