mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
refactor(web/radial): move center icon into absolute div
fixes annoying issues when trying to rotate the icon
This commit is contained in:
@@ -44,9 +44,15 @@ const useStyles = createStyles((theme) => ({
|
|||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
centerIconContainer: {
|
||||||
|
position: 'absolute',
|
||||||
|
top: '50%',
|
||||||
|
left: '50%',
|
||||||
|
transform: 'translate(-50%, -50%)',
|
||||||
|
pointerEvents: 'none',
|
||||||
|
},
|
||||||
centerIcon: {
|
centerIcon: {
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
pointerEvents: 'none',
|
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -120,7 +126,6 @@ const RadialMenu: React.FC = () => {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
{/* TODO: rotate go back icon */}
|
|
||||||
<g
|
<g
|
||||||
transform={`translate(175, 175)`}
|
transform={`translate(175, 175)`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -133,16 +138,16 @@ const RadialMenu: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<circle r={30} className={classes.centerCircle} />
|
<circle r={30} className={classes.centerCircle} />
|
||||||
</g>
|
</g>
|
||||||
|
</svg>
|
||||||
|
<div className={classes.centerIconContainer}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={!menu.sub ? 'xmark' : 'arrow-rotate-left'}
|
icon={!menu.sub ? 'xmark' : 'arrow-rotate-left'}
|
||||||
|
fixedWidth
|
||||||
className={classes.centerIcon}
|
className={classes.centerIcon}
|
||||||
color="#fff"
|
color="#fff"
|
||||||
width={28}
|
size="2x"
|
||||||
height={28}
|
|
||||||
x={175 - 28 / 2}
|
|
||||||
y={175 - 28 / 2}
|
|
||||||
/>
|
/>
|
||||||
</svg>
|
</div>
|
||||||
</ScaleFade>
|
</ScaleFade>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user