Files
ox_lib/web/src/features/dev/index.tsx

79 lines
2.6 KiB
TypeScript
Raw Normal View History

2022-12-16 12:03:31 +01:00
import { ActionIcon, Tooltip, Drawer, Stack, Divider, Button } from '@mantine/core';
2022-08-27 15:58:36 +02:00
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { debugAlert } from './debug/alert';
import { debugContext } from './debug/context';
import { debugInput } from './debug/input';
import { debugMenu } from './debug/menu';
import { debugCustomNotification } from './debug/notification';
2022-08-27 15:58:36 +02:00
import { debugCircleProgressbar, debugProgressbar } from './debug/progress';
import { debugTextUI } from './debug/textui';
import { debugSkillCheck } from './debug/skillcheck';
2022-12-16 12:03:31 +01:00
import { useState } from 'react';
import { debugRadial } from './debug/radial';
const Dev: React.FC = () => {
2022-12-16 12:03:31 +01:00
const [opened, setOpened] = useState(false);
return (
<>
2022-12-16 12:03:31 +01:00
<Tooltip label="Developer drawer" position="bottom">
<ActionIcon
onClick={() => setOpened(true)}
radius="xl"
variant="filled"
color="orange"
sx={{ position: 'absolute', bottom: 0, right: 0, width: 50, height: 50 }}
size="xl"
mr={50}
mb={50}
>
<FontAwesomeIcon icon="wrench" fontSize={24} />
</ActionIcon>
</Tooltip>
2022-12-16 12:03:31 +01:00
<Drawer position="left" onClose={() => setOpened(false)} opened={opened} title="Developer drawer" padding="xl">
<Stack>
<Divider />
<Button fullWidth onClick={() => debugInput()}>
Open input dialog
</Button>
<Button fullWidth onClick={() => debugAlert()}>
Open alert dialog
</Button>
<Divider />
<Button fullWidth onClick={() => debugContext()}>
Open context menu
</Button>
<Button fullWidth onClick={() => debugMenu()}>
Open list menu
</Button>
<Button fullWidth onClick={() => debugRadial()}>
Open radial menu
</Button>
2022-12-16 12:03:31 +01:00
<Divider />
<Button fullWidth onClick={() => debugCustomNotification()}>
Send notification
2022-12-16 12:03:31 +01:00
</Button>
<Divider />
<Button fullWidth onClick={() => debugProgressbar()}>
Activate progress bar
</Button>
<Button fullWidth onClick={() => debugCircleProgressbar()}>
Activate progress circle
</Button>
<Divider />
<Button fullWidth onClick={() => debugTextUI()}>
Show TextUI
</Button>
<Divider />
<Button fullWidth onClick={() => debugSkillCheck()}>
Run skill check
</Button>
</Stack>
</Drawer>
</>
);
};
export default Dev;