From 06dede7d3b220373f968058399b67606dd1ca54e Mon Sep 17 00:00:00 2001 From: popovspiridon99 Date: Fri, 14 Nov 2025 17:14:43 +0900 Subject: [PATCH] set AGGrid theme in DashboardLayout --- client/src/layouts/DashboardLayout.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/layouts/DashboardLayout.tsx b/client/src/layouts/DashboardLayout.tsx index db7986e..c99ee13 100644 --- a/client/src/layouts/DashboardLayout.tsx +++ b/client/src/layouts/DashboardLayout.tsx @@ -75,6 +75,14 @@ function DashboardLayout() { const [navbarOpen, setNavbarOpen] = useState(true) + useEffect(() => { + if (colorScheme === 'dark') { + document.body.dataset.agThemeMode = 'dark' + } else { + document.body.dataset.agThemeMode = 'light' + } + }, [colorScheme]) + return (
@@ -103,7 +111,7 @@ function DashboardLayout() { {!authStore.isAuthenticated && } onClick={() => navigate('/auth/signin')}>Войти} - + : } onClick={() => colorScheme === 'dark' ? setColorScheme('light') : setColorScheme('dark')}>Тема: {colorScheme === 'dark' ? 'тёмная' : 'светлая'} {authStore.isAuthenticated && } onClick={() => navigate('/settings')}>Настройки профиля} {authStore.isAuthenticated && } onClick={() => {