mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-13 08:55:48 +01:00
✨Add improved settings button
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Menu, useMantineColorScheme, useMantineTheme } from '@mantine/core';
|
||||
import { IconMoonStars, IconSun } from '@tabler/icons';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
export const ColorSchemeSwitch = () => {
|
||||
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
|
||||
const { t } = useTranslation('settings/general/theme-selector');
|
||||
|
||||
const Icon = colorScheme === 'dark' ? IconSun : IconMoonStars;
|
||||
|
||||
return (
|
||||
<Menu.Item
|
||||
closeMenuOnClick={false}
|
||||
icon={<Icon strokeWidth={1.2} size={18} />}
|
||||
onClick={() => toggleColorScheme()}
|
||||
>
|
||||
{t('label', {
|
||||
theme: colorScheme === 'dark' ? 'light' : 'dark',
|
||||
})}
|
||||
</Menu.Item>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user