account preferences

This commit is contained in:
Philipinho
2024-04-27 23:34:20 +01:00
parent 33456f1bd0
commit d68d035b52
4 changed files with 69 additions and 5 deletions

View File

@ -0,0 +1,45 @@
import {
Group,
Text,
useMantineColorScheme,
Select,
MantineColorScheme,
} from "@mantine/core";
export default function AccountTheme() {
return (
<Group justify="space-between" wrap="nowrap" gap="xl">
<div>
<Text size="md">Theme</Text>
<Text size="sm" c="dimmed">
Choose your preferred color scheme.
</Text>
</div>
<ThemeSwitcher />
</Group>
);
}
function ThemeSwitcher() {
const { colorScheme, setColorScheme } = useMantineColorScheme();
const handleChange = (value: MantineColorScheme) => {
setColorScheme(value);
};
return (
<Select
label="Select theme"
data={[
{ value: "light", label: "Light" },
{ value: "dark", label: "Dark" },
{ value: "auto", label: "System settings" },
]}
value={colorScheme}
onChange={handleChange}
allowDeselect={false}
checkIconPosition="right"
/>
);
}