mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 09:25:47 +01:00
Edit ColorSchemeToggle
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { ActionIcon, useMantineColorScheme } from '@mantine/core';
|
import { ActionIcon, Box, useMantineColorScheme } from '@mantine/core';
|
||||||
import { Sun, MoonStars } from 'tabler-icons-react';
|
import { Sun, MoonStars } from 'tabler-icons-react';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
|
|
||||||
@@ -14,15 +14,15 @@ export function ColorSchemeToggle() {
|
|||||||
borderRadius: '100%',
|
borderRadius: '100%',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ActionIcon
|
<Box
|
||||||
onClick={() => toggleColorScheme()}
|
onClick={() => toggleColorScheme()}
|
||||||
size="xl"
|
|
||||||
sx={(theme) => ({
|
sx={(theme) => ({
|
||||||
|
cursor: "pointer",
|
||||||
color: theme.colorScheme === 'dark' ? theme.colors.yellow[4] : theme.colors.blue[6],
|
color: theme.colorScheme === 'dark' ? theme.colors.yellow[4] : theme.colors.blue[6],
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{colorScheme === 'dark' ? <Sun size={24} /> : <MoonStars size={24} />}
|
{colorScheme === 'dark' ? <Sun size={24} /> : <MoonStars size={24} />}
|
||||||
</ActionIcon>
|
</Box>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user