mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
Add theme mode translation
This commit is contained in:
@@ -2,8 +2,10 @@ import { useThemeContext } from './ThemeContext';
|
||||
import { IconButton, Tooltip } from '@mui/material';
|
||||
import LightModeIcon from '@mui/icons-material/LightMode';
|
||||
import DarkModeIcon from '@mui/icons-material/DarkMode';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const ThemeSelector = () => {
|
||||
const { t } = useTranslation(['core']);
|
||||
const { themeMode, toggleTheme } = useThemeContext();
|
||||
|
||||
return (
|
||||
@@ -16,7 +18,17 @@ const ThemeSelector = () => {
|
||||
position: 'absolute',
|
||||
}}
|
||||
>
|
||||
<Tooltip title={themeMode === 'dark' ? 'Light mode' : 'Dark mode'}>
|
||||
<Tooltip
|
||||
title={
|
||||
themeMode === 'dark'
|
||||
? t('core:theme.light', {
|
||||
postProcess: 'capitalize',
|
||||
})
|
||||
: t('core:theme.light', {
|
||||
postProcess: 'capitalize',
|
||||
})
|
||||
}
|
||||
>
|
||||
<IconButton onClick={toggleTheme}>
|
||||
{themeMode === 'dark' ? <LightModeIcon /> : <DarkModeIcon />}
|
||||
</IconButton>
|
||||
|
Reference in New Issue
Block a user