set AGGrid theme in DashboardLayout
This commit is contained in:
@ -75,6 +75,14 @@ function DashboardLayout() {
|
|||||||
|
|
||||||
const [navbarOpen, setNavbarOpen] = useState(true)
|
const [navbarOpen, setNavbarOpen] = useState(true)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (colorScheme === 'dark') {
|
||||||
|
document.body.dataset.agThemeMode = 'dark'
|
||||||
|
} else {
|
||||||
|
document.body.dataset.agThemeMode = 'light'
|
||||||
|
}
|
||||||
|
}, [colorScheme])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<div className={classes.header}>
|
<div className={classes.header}>
|
||||||
@ -103,7 +111,7 @@ function DashboardLayout() {
|
|||||||
<MenuPopover>
|
<MenuPopover>
|
||||||
<MenuList>
|
<MenuList>
|
||||||
{!authStore.isAuthenticated && <MenuItem icon={<IconLogin />} onClick={() => navigate('/auth/signin')}>Войти</MenuItem>}
|
{!authStore.isAuthenticated && <MenuItem icon={<IconLogin />} onClick={() => navigate('/auth/signin')}>Войти</MenuItem>}
|
||||||
|
|
||||||
<MenuItem icon={colorScheme === 'dark' ? <IconMoon /> : <IconSun />} onClick={() => colorScheme === 'dark' ? setColorScheme('light') : setColorScheme('dark')}>Тема: {colorScheme === 'dark' ? 'тёмная' : 'светлая'}</MenuItem>
|
<MenuItem icon={colorScheme === 'dark' ? <IconMoon /> : <IconSun />} onClick={() => colorScheme === 'dark' ? setColorScheme('light') : setColorScheme('dark')}>Тема: {colorScheme === 'dark' ? 'тёмная' : 'светлая'}</MenuItem>
|
||||||
{authStore.isAuthenticated && <MenuItem icon={<IconSettings />} onClick={() => navigate('/settings')}>Настройки профиля</MenuItem>}
|
{authStore.isAuthenticated && <MenuItem icon={<IconSettings />} onClick={() => navigate('/settings')}>Настройки профиля</MenuItem>}
|
||||||
{authStore.isAuthenticated && <MenuItem icon={<IconLogout />} onClick={() => {
|
{authStore.isAuthenticated && <MenuItem icon={<IconLogout />} onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user