mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
refactor(web/menu): radial menu visibility handling
This commit is contained in:
20
web/src/features/dev/debug/radial.ts
Normal file
20
web/src/features/dev/debug/radial.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { debugData } from '../../../utils/debugData';
|
||||
import type { MenuItem } from '../../menu/radial';
|
||||
|
||||
export const debugRadial = () => {
|
||||
debugData<{ items: MenuItem[]; sub?: boolean }>([
|
||||
{
|
||||
action: 'openRadialMenu',
|
||||
data: {
|
||||
items: [
|
||||
// TODO: Fix wheel being broken when there's only one item
|
||||
{ icon: 'palette', label: 'Paint' },
|
||||
{ icon: 'warehouse', label: 'Garage' },
|
||||
{ icon: 'palette', label: 'Quite long text' },
|
||||
{ icon: 'palette', label: 'Paint' },
|
||||
{ icon: 'warehouse', label: 'Garage' },
|
||||
],
|
||||
},
|
||||
},
|
||||
]);
|
||||
};
|
||||
@@ -9,6 +9,7 @@ import { debugCircleProgressbar, debugProgressbar } from './debug/progress';
|
||||
import { debugTextUI } from './debug/textui';
|
||||
import { debugSkillCheck } from './debug/skillcheck';
|
||||
import { useState } from 'react';
|
||||
import { debugRadial } from './debug/radial';
|
||||
|
||||
const Dev: React.FC = () => {
|
||||
const [opened, setOpened] = useState(false);
|
||||
@@ -46,6 +47,9 @@ const Dev: React.FC = () => {
|
||||
<Button fullWidth onClick={() => debugMenu()}>
|
||||
Open list menu
|
||||
</Button>
|
||||
<Button fullWidth onClick={() => debugRadial()}>
|
||||
Open radial menu
|
||||
</Button>
|
||||
<Divider />
|
||||
<Button fullWidth onClick={() => debugCustomNotification()}>
|
||||
Send notification
|
||||
|
||||
Reference in New Issue
Block a user