Merge pull request #71 from nbenaglia/feature/theme-adjustments

Apply theme color to mode icon
This commit is contained in:
nico.benaz 2025-06-02 21:27:14 +02:00 committed by GitHub
commit 75f0fbd773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
import { useThemeContext } from './ThemeContext';
import { Box, IconButton, Tooltip } from '@mui/material';
import { Box, IconButton, Tooltip, useTheme } from '@mui/material';
import LightModeIcon from '@mui/icons-material/LightMode';
import DarkModeIcon from '@mui/icons-material/DarkMode';
import { useTranslation } from 'react-i18next';
@ -15,6 +15,7 @@ const ThemeSelector = () => {
]);
const { themeMode, toggleTheme } = useThemeContext();
const selectorRef = useRef(null);
const theme = useTheme();
return (
<Box ref={selectorRef}>
@ -29,7 +30,12 @@ const ThemeSelector = () => {
})
}
>
<IconButton onClick={toggleTheme}>
<IconButton
onClick={toggleTheme}
sx={{
color: theme.palette.text.secondary,
}}
>
{themeMode === 'dark' ? <LightModeIcon /> : <DarkModeIcon />}
</IconButton>
</Tooltip>