From 485841a774b421d2ef16368c46183dd769c637c0 Mon Sep 17 00:00:00 2001 From: anish-work Date: Thu, 29 Aug 2024 20:51:33 +0530 Subject: [PATCH] auto close sidebar in mobile --- src/components/shared/Layout/SideNavbar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/shared/Layout/SideNavbar.tsx b/src/components/shared/Layout/SideNavbar.tsx index 12a7683..8f195c6 100644 --- a/src/components/shared/Layout/SideNavbar.tsx +++ b/src/components/shared/Layout/SideNavbar.tsx @@ -223,7 +223,11 @@ const SideNavbar = () => { isActive={ currentConversationId === conversation?.id } - onClick={() => setActiveConversation(conversation)} + onClick={() => { + setActiveConversation(conversation); + if (layoutController?.isMobile) + layoutController?.toggleSidebar(); + }} /> );