From 819bb60bd30121628bfcdfb0e5efc869a3fd1748 Mon Sep 17 00:00:00 2001 From: Luke <39926192+LukeWasTakenn@users.noreply.github.com> Date: Sun, 22 Jan 2023 14:00:44 +0100 Subject: [PATCH] refactor(web/menu): attempt alignment doka pls fix --- web/src/features/menu/planet/index.tsx | 52 ++++++++++++-------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/web/src/features/menu/planet/index.tsx b/web/src/features/menu/planet/index.tsx index d5a8a18a7..4dff2210c 100644 --- a/web/src/features/menu/planet/index.tsx +++ b/web/src/features/menu/planet/index.tsx @@ -30,9 +30,11 @@ debugData<{ items: MenuItem[]; sub?: boolean }>([ items: [ { icon: 'palette', label: 'Paint' }, { icon: 'warehouse', label: 'Garage' }, + { icon: 'palette', label: 'Quite long text' }, { icon: 'palette', label: 'Paint' }, - // { icon: 'warehouse', label: 'Garage' }, + { icon: 'warehouse', label: 'Garage' }, ], + sub: false, }, }, @@ -99,14 +101,16 @@ const useStyles = createStyles((theme) => ({ sector: { fill: theme.colors.dark[6], color: theme.colors.dark[0], + '&:hover': { fill: theme.fn.primaryColor(), + '> g > text, > g > svg > path': { + fill: '#fff', + }, + }, + '> g > text': { + fill: theme.colors.dark[0], }, - stroke: '#fff', - strokeWidth: '1px', - }, - circleIcon: { - // position: 'relative', }, })); @@ -134,37 +138,29 @@ const PlanetMenu: React.FC = () => { return ( <> - + {menu.items.map((item, index) => { - // TODO: center labels and icon inside sector const pieAngle = 360 / menu.items.length; const angle = degToRad(pieAngle / 2 + 90); - const radius = 250 / 2; - const iconX = 250 + Math.sin(angle) * radius; - const iconY = 250 + Math.cos(angle) * radius; + const radius = 175 / 2; + const iconX = 175 + Math.sin(angle) * radius; + const iconY = 175 + Math.cos(angle) * radius; return ( <> - + - - {item.label} - - {/**/} + + + + {item.label} + + );