mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 09:25:47 +01:00
✨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:
23
src/components/ThemeSchemeToggle/ThemeSchemeToggle.tsx
Normal file
23
src/components/ThemeSchemeToggle/ThemeSchemeToggle.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user