refactor(web/menu): radial menu item onClick

This commit is contained in:
Luke
2023-01-30 19:22:45 +01:00
parent 0c6661714f
commit 3fb66f30d4

View File

@@ -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))