2022-06-07 08:21:03 +02:00
|
|
|
import { ActionIcon, Title, Tooltip, Drawer, Tabs } from '@mantine/core';
|
|
|
|
|
import { useHotkeys } from '@mantine/hooks';
|
2022-05-18 22:08:09 +02:00
|
|
|
import { useState } from 'react';
|
2022-06-07 08:21:03 +02:00
|
|
|
import { IconSettings } from '@tabler/icons';
|
2022-06-07 00:07:56 +00:00
|
|
|
import AdvancedSettings from './AdvancedSettings';
|
2022-06-07 08:21:03 +02:00
|
|
|
import CommonSettings from './CommonSettings';
|
2022-04-27 03:12:17 +02:00
|
|
|
|
|
|
|
|
function SettingsMenu(props: any) {
|
|
|
|
|
return (
|
2022-06-07 08:21:03 +02:00
|
|
|
<Tabs grow>
|
|
|
|
|
<Tabs.Tab data-autofocus label="Common">
|
|
|
|
|
<CommonSettings />
|
2022-06-07 00:07:56 +00:00
|
|
|
</Tabs.Tab>
|
2022-06-11 19:42:36 +02:00
|
|
|
<Tabs.Tab label="Customisations">
|
2022-06-07 00:07:56 +00:00
|
|
|
<AdvancedSettings />
|
|
|
|
|
</Tabs.Tab>
|
|
|
|
|
</Tabs>
|
2022-04-27 03:12:17 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SettingsMenuButton(props: any) {
|
2022-05-24 23:02:27 +02:00
|
|
|
useHotkeys([['ctrl+L', () => setOpened(!opened)]]);
|
|
|
|
|
|
2022-04-27 03:12:17 +02:00
|
|
|
const [opened, setOpened] = useState(false);
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2022-05-24 22:55:10 +02:00
|
|
|
<Drawer
|
2022-06-07 08:20:19 +02:00
|
|
|
size="xl"
|
2022-05-24 22:55:10 +02:00
|
|
|
padding="xl"
|
|
|
|
|
position="right"
|
2022-04-27 03:12:17 +02:00
|
|
|
title={<Title order={3}>Settings</Title>}
|
|
|
|
|
opened={props.opened || opened}
|
|
|
|
|
onClose={() => setOpened(false)}
|
|
|
|
|
>
|
2022-05-18 22:08:09 +02:00
|
|
|
<SettingsMenu />
|
2022-05-24 22:55:10 +02:00
|
|
|
</Drawer>
|
2022-04-27 03:12:17 +02:00
|
|
|
<ActionIcon
|
|
|
|
|
variant="default"
|
2022-05-14 21:42:11 +02:00
|
|
|
radius="md"
|
2022-04-30 21:35:39 +02:00
|
|
|
size="xl"
|
|
|
|
|
color="blue"
|
2022-04-27 03:12:17 +02:00
|
|
|
style={props.style}
|
|
|
|
|
onClick={() => setOpened(true)}
|
|
|
|
|
>
|
|
|
|
|
<Tooltip label="Settings">
|
2022-05-29 18:42:58 +02:00
|
|
|
<IconSettings />
|
2022-04-27 03:12:17 +02:00
|
|
|
</Tooltip>
|
|
|
|
|
</ActionIcon>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|