mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
refactor(web/menu): radial menu item onClick
This commit is contained in:
@@ -78,9 +78,10 @@ const RadialMenu: React.FC = () => {
|
|||||||
setVisible(true);
|
setVisible(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleItemClick = (index: number) => {
|
const handleClick = (index: number) => {
|
||||||
// fetchNui('planetClick', index)
|
fetchNui('radialClick', index);
|
||||||
// setVisible(false);
|
// TODO: shouldClose
|
||||||
|
setVisible(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -103,7 +104,11 @@ const RadialMenu: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<g transform={`rotate(-${index * pieAngle} 175 175)`} className={classes.sector}>
|
<g
|
||||||
|
transform={`rotate(-${index * pieAngle} 175 175)`}
|
||||||
|
className={classes.sector}
|
||||||
|
onClick={() => handleClick(index)}
|
||||||
|
>
|
||||||
<path
|
<path
|
||||||
d={`M175.01,175.01 l175,0 A175.01,175.01 0 0,0 ${175 + 175 * Math.cos(-degToRad(pieAngle))}, ${
|
d={`M175.01,175.01 l175,0 A175.01,175.01 0 0,0 ${175 + 175 * Math.cos(-degToRad(pieAngle))}, ${
|
||||||
175 + 175 * Math.sin(-degToRad(pieAngle))
|
175 + 175 * Math.sin(-degToRad(pieAngle))
|
||||||
|
|||||||
Reference in New Issue
Block a user