🎨 Improve color scheme logic

This commit is contained in:
Meier Lukas
2023-07-29 14:30:19 +02:00
parent c312828c79
commit c165648d5b
10 changed files with 169 additions and 115 deletions

View File

@@ -1,9 +1,10 @@
import { Menu, useMantineColorScheme } from '@mantine/core';
import { Menu } from '@mantine/core';
import { IconMoonStars, IconSun } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useColorScheme } from '~/hooks/use-colorscheme';
export const ColorSchemeSwitch = () => {
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
const { colorScheme, toggleColorScheme } = useColorScheme();
const { t } = useTranslation('settings/general/theme-selector');
const Icon = colorScheme === 'dark' ? IconSun : IconMoonStars;