Skip to content

Commit

Permalink
Update Menu.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
cdedreuille committed Sep 21, 2023
1 parent 7660f3d commit 44e0cd9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions code/ui/manager/src/components/sidebar/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const SidebarIconButton: FC<

const MenuButtonGroup = styled.div({
display: 'flex',
gap: 5,
gap: 4,
});

const Img = styled.img(sharedStyles);
Expand Down Expand Up @@ -119,7 +119,7 @@ export interface SidebarMenuProps {

export const SidebarMenu: FC<SidebarMenuProps> = ({ menu, isHighlighted, onClick }) => {
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
const { isDesktop } = useLayout();
const { isDesktop, setMobileMenuOpen } = useLayout();

if (!isDesktop) {
return (
Expand All @@ -133,8 +133,12 @@ export const SidebarMenu: FC<SidebarMenuProps> = ({ menu, isHighlighted, onClick
>
<Icons icon="cog" />
</SidebarIconButton>
<CloseIconButton title="Close menu" aria-label="Close menu" onClick={onClick}>
<Icons icon="cross" />
<CloseIconButton
title="Close menu"
aria-label="Close menu"
onClick={() => setMobileMenuOpen(false)}
>
<Icons icon="close" />
</CloseIconButton>
</MenuButtonGroup>
);
Expand Down

0 comments on commit 44e0cd9

Please sign in to comment.