mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-13 11:31:22 +00:00
Merge pull request #71 from nbenaglia/feature/theme-adjustments
Apply theme color to mode icon
This commit is contained in:
commit
75f0fbd773
@ -1,5 +1,5 @@
|
|||||||
import { useThemeContext } from './ThemeContext';
|
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 LightModeIcon from '@mui/icons-material/LightMode';
|
||||||
import DarkModeIcon from '@mui/icons-material/DarkMode';
|
import DarkModeIcon from '@mui/icons-material/DarkMode';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -15,6 +15,7 @@ const ThemeSelector = () => {
|
|||||||
]);
|
]);
|
||||||
const { themeMode, toggleTheme } = useThemeContext();
|
const { themeMode, toggleTheme } = useThemeContext();
|
||||||
const selectorRef = useRef(null);
|
const selectorRef = useRef(null);
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box ref={selectorRef}>
|
<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 />}
|
{themeMode === 'dark' ? <LightModeIcon /> : <DarkModeIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user