2022-12-20 11:45:33 +09:00
|
|
|
import { Title, Drawer, Tabs, ScrollArea } from '@mantine/core';
|
2022-08-22 09:50:54 +02:00
|
|
|
import { useTranslation } from 'next-i18next';
|
2022-08-18 21:46:46 +02:00
|
|
|
|
2022-12-06 21:22:37 +01:00
|
|
|
import CustomizationSettings from './Customization/CustomizationSettings';
|
|
|
|
|
import CommonSettings from './Common/CommonSettings';
|
|
|
|
|
import Credits from './Common/Credits';
|
2022-04-27 03:12:17 +02:00
|
|
|
|
2022-12-04 17:36:30 +01:00
|
|
|
function SettingsMenu() {
|
2022-08-22 09:50:54 +02:00
|
|
|
const { t } = useTranslation('settings/common');
|
|
|
|
|
|
2022-04-27 03:12:17 +02:00
|
|
|
return (
|
2022-12-04 17:36:30 +01:00
|
|
|
<Tabs defaultValue="common">
|
2022-07-26 00:51:55 +02:00
|
|
|
<Tabs.List grow>
|
2022-12-04 17:36:30 +01:00
|
|
|
<Tabs.Tab value="common">{t('tabs.common')}</Tabs.Tab>
|
|
|
|
|
<Tabs.Tab value="customization">{t('tabs.customizations')}</Tabs.Tab>
|
2022-07-26 00:51:55 +02:00
|
|
|
</Tabs.List>
|
2022-12-04 17:36:30 +01:00
|
|
|
<Tabs.Panel data-autofocus value="common">
|
2022-06-28 11:06:45 +02:00
|
|
|
<ScrollArea style={{ height: '78vh' }} offsetScrollbars>
|
|
|
|
|
<CommonSettings />
|
|
|
|
|
</ScrollArea>
|
2022-07-26 00:51:55 +02:00
|
|
|
</Tabs.Panel>
|
2022-12-04 17:36:30 +01:00
|
|
|
<Tabs.Panel value="customization">
|
2022-06-28 11:06:45 +02:00
|
|
|
<ScrollArea style={{ height: '78vh' }} offsetScrollbars>
|
2022-12-04 17:36:30 +01:00
|
|
|
<CustomizationSettings />
|
2022-06-28 11:06:45 +02:00
|
|
|
</ScrollArea>
|
2022-07-26 00:51:55 +02:00
|
|
|
</Tabs.Panel>
|
2022-06-07 00:07:56 +00:00
|
|
|
</Tabs>
|
2022-04-27 03:12:17 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-04 18:20:25 +01:00
|
|
|
interface SettingsDrawerProps {
|
|
|
|
|
opened: boolean;
|
|
|
|
|
closeDrawer: () => void;
|
|
|
|
|
}
|
2022-05-24 23:02:27 +02:00
|
|
|
|
2022-12-04 18:20:25 +01:00
|
|
|
export function SettingsDrawer({ opened, closeDrawer }: SettingsDrawerProps) {
|
|
|
|
|
const { t } = useTranslation('settings/common');
|
2022-08-22 09:50:54 +02:00
|
|
|
|
2022-04-27 03:12:17 +02:00
|
|
|
return (
|
2022-12-04 18:20:25 +01:00
|
|
|
<Drawer
|
|
|
|
|
size="xl"
|
|
|
|
|
padding="lg"
|
|
|
|
|
position="right"
|
|
|
|
|
title={<Title order={5}>{t('title')}</Title>}
|
|
|
|
|
opened={opened}
|
|
|
|
|
onClose={closeDrawer}
|
|
|
|
|
>
|
|
|
|
|
<SettingsMenu />
|
|
|
|
|
<Credits />
|
|
|
|
|
</Drawer>
|
2022-04-27 03:12:17 +02:00
|
|
|
);
|
|
|
|
|
}
|