From 8ec0e5574e0fc7058406642d425d07e5633cf245 Mon Sep 17 00:00:00 2001 From: drler0 Date: Thu, 21 Nov 2024 13:48:41 -0800 Subject: [PATCH 1/3] Closes sidebar when menu item is clicked --- client/src/components/Sidebar/Sidebar.jsx | 13 +++++++++++-- client/src/components/Sidebar/SidebarNavSection.jsx | 9 ++++++--- client/src/stories/Header/Header.jsx | 4 ++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/client/src/components/Sidebar/Sidebar.jsx b/client/src/components/Sidebar/Sidebar.jsx index 1f132be4..5456bc2a 100644 --- a/client/src/components/Sidebar/Sidebar.jsx +++ b/client/src/components/Sidebar/Sidebar.jsx @@ -11,6 +11,8 @@ import { IconSpeakerphone, IconSquareArrowRight, } from '@tabler/icons-react'; +import PropTypes from 'prop-types'; + import { SidebarNavSection, SidebarLink } from './SidebarNavSection'; @@ -61,10 +63,14 @@ const sections = [ }, ]; +const SidebarProps = { + toggleSidebar: PropTypes.func, +}; + /** * Collapsible sidebar */ -export function Sidebar() { +export function Sidebar({toggleSidebar}) { return (