Auth Page Dark/Light mode toggle button (#1265)

*  Dark/Light toggle button

* 💄 Moved button to top right

* 💄 Moved button to top right

*  Toggle Button component + integrations

* 💄 Rounding corners + Floating background onboard
This commit is contained in:
Tagaishi
2023-09-02 07:00:02 +02:00
committed by GitHub
parent 981c964ba9
commit 5f2ddcd2c4
4 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
import {
ActionIcon,
ActionIconProps,
} from '@mantine/core';
import { useColorScheme } from '~/hooks/use-colorscheme';
import { IconMoonStars, IconSun } from '@tabler/icons-react';
export const ThemeSchemeToggle = (props : Partial<ActionIconProps>) => {
const { colorScheme, toggleColorScheme } = useColorScheme();
const Icon = colorScheme === 'dark' ? IconSun : IconMoonStars;
return (
<ActionIcon
size={50}
variant="outline"
radius="md"
onClick={toggleColorScheme}
{...props}
>
<Icon size="66%"/>
</ActionIcon>
);
};