mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
refactor(web/menu): improve radial menu transitions
This commit is contained in:
@@ -74,12 +74,6 @@ const RadialMenu: React.FC = () => {
|
||||
setMenu({ ...menu, items: data });
|
||||
});
|
||||
|
||||
const handleClick = async (index: number) => {
|
||||
fetchNui('radialClick', index);
|
||||
// TODO: shouldClose
|
||||
setVisible(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box className={classes.wrapper}>
|
||||
@@ -102,7 +96,7 @@ const RadialMenu: React.FC = () => {
|
||||
<g
|
||||
transform={`rotate(-${index * pieAngle} 175 175)`}
|
||||
className={classes.sector}
|
||||
onClick={() => handleClick(index)}
|
||||
onClick={() => fetchNui('radialClick', index)}
|
||||
>
|
||||
<path
|
||||
d={`M175.01,175.01 l175,0 A175.01,175.01 0 0,0 ${175 + 175 * Math.cos(-degToRad(pieAngle))}, ${
|
||||
@@ -130,8 +124,7 @@ const RadialMenu: React.FC = () => {
|
||||
<g
|
||||
transform={`translate(175, 175)`}
|
||||
onClick={() => {
|
||||
setVisible(false);
|
||||
menu.sub && fetchNui('radialBack');
|
||||
menu.sub ? fetchNui('radialBack') : setVisible(false);
|
||||
}}
|
||||
>
|
||||
<circle r={30} className={classes.centerCircle} />
|
||||
|
||||
Reference in New Issue
Block a user