Skip to content

Commit

Permalink
feat: add width 100 on menu items to standardize hover effect width (#…
Browse files Browse the repository at this point in the history
…2285)

add width 100%, flex-start & marginRight auto to have standardized width hover on menu item
  • Loading branch information
Samuel Billaud authored Sep 27, 2023
1 parent 5e75b01 commit 62b2e52
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/Sidebar/NavItems.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable react/no-array-index-key */
/* eslint-disable @typescript-eslint/no-use-before-define */
import {
Box,
Button,
Collapse,
Stack,
Expand Down Expand Up @@ -53,10 +54,12 @@ function NavButton({
roundedLeft="none"
roundedRight="full"
fontWeight="normal"
width="100%"
justifyContent="flex-start"
{...buttonProps}
{...props}
>
<chakra.span>{children}</chakra.span>
<chakra.span marginRight="auto">{children}</chakra.span>
</Button>
);
}
Expand All @@ -75,7 +78,7 @@ function NavGroup({ group, depth }) {
const isActive = getItemPaths(group.children, basePath).some((path) => isPathActive(path, uri));

return (
<div>
<Box width="100%" justifyContent="flex-start">
<NavButton
mb="1"
fontWeight="strong"
Expand Down Expand Up @@ -103,7 +106,7 @@ function NavGroup({ group, depth }) {
depth={depth + 1}
/>
</Collapse>
</div>
</Box>
);
}

Expand Down

0 comments on commit 62b2e52

Please sign in to comment.