mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-16 04:51:20 +00:00
Add theme mode translation
This commit is contained in:
parent
09dfc51366
commit
b3a4d4c5d6
@ -25,11 +25,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"save_options": {
|
"save_options": {
|
||||||
"publish_qdn": "Would you like to publish your settings to QDN (encrypted) ?",
|
"publish_qdn": "Would you like to publish your settings to QDN (encrypted)?",
|
||||||
"save": "save"
|
"save": "save"
|
||||||
},
|
},
|
||||||
"settings": "settings",
|
"settings": "settings",
|
||||||
"supply": "supply",
|
"supply": "supply",
|
||||||
|
"theme": {
|
||||||
|
"dark": "dark mode",
|
||||||
|
"light": "light mode"
|
||||||
|
},
|
||||||
"title": "title",
|
"title": "title",
|
||||||
"tutorial": "tutorial",
|
"tutorial": "tutorial",
|
||||||
"your_account": "your account",
|
"your_account": "your account",
|
||||||
|
@ -2,8 +2,10 @@ import { useThemeContext } from './ThemeContext';
|
|||||||
import { IconButton, Tooltip } from '@mui/material';
|
import { IconButton, Tooltip } 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';
|
||||||
|
|
||||||
const ThemeSelector = () => {
|
const ThemeSelector = () => {
|
||||||
|
const { t } = useTranslation(['core']);
|
||||||
const { themeMode, toggleTheme } = useThemeContext();
|
const { themeMode, toggleTheme } = useThemeContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -16,7 +18,17 @@ const ThemeSelector = () => {
|
|||||||
position: 'absolute',
|
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}>
|
<IconButton onClick={toggleTheme}>
|
||||||
{themeMode === 'dark' ? <LightModeIcon /> : <DarkModeIcon />}
|
{themeMode === 'dark' ? <LightModeIcon /> : <DarkModeIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user