Skip to content

Commit ef5838c

Browse files
authored
🐛 close sidebar on user selection
Issue: The SidebarItems component has an onClose prop that's being passed to the RouterLink onClick handler, but in the Sidebar component, we are not passing this prop to SidebarItems. Fix: Now when a user clicks on any navigation item in the sidebar or the logout button, the drawer will automatically close as the new page loads. The onClose function is passed to each RouterLink in the SidebarItems component, which will trigger when a user clicks on a menu option.
1 parent 6efd3ba commit ef5838c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/src/components/Common/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const Sidebar = () => {
4949
<DrawerBody>
5050
<Flex flexDir="column" justify="space-between">
5151
<Box>
52-
<SidebarItems />
52+
<SidebarItems onClose={() => setOpen(false)} />
5353
<Flex
5454
as="button"
5555
onClick={() => {

0 commit comments

Comments
 (0)