From 800a875a8f079dffe341240106b05488564eb6fd Mon Sep 17 00:00:00 2001 From: 01zulfi <85733202+01zulfi@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:44:32 +0500 Subject: [PATCH] web: collapse hovered navbar when item is clicked (#7771) Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com> --- .../src/components/navigation-menu/index.tsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/navigation-menu/index.tsx b/apps/web/src/components/navigation-menu/index.tsx index 14b82abf6..ad4ff7e37 100644 --- a/apps/web/src/components/navigation-menu/index.tsx +++ b/apps/web/src/components/navigation-menu/index.tsx @@ -467,7 +467,8 @@ function RouteItem({ : location.startsWith(item.path) } onClick={() => { - if (navigateToRoute(item.path)) context?.collapse(); + navigateToRoute(item.path); + context?.collapse(); }} menuItems={[ { @@ -512,7 +513,8 @@ function Colors({ selected={context?.id === color.id} color={color.colorCode} onClick={() => { - if (navigateToRoute(`/colors/${color.id}`)) collapse(); + navigateToRoute(`/colors/${color.id}`); + collapse(); }} onDrop={(e) => handleDrop(e.dataTransfer, color)} menuItems={[ @@ -601,14 +603,12 @@ function Shortcuts({ selected={context?.id === item.id} onDrop={(e) => handleDrop(e.dataTransfer, item)} onClick={async () => { - if ( - navigateToRoute( - item.type === "notebook" - ? `/notebooks/${item.id}` - : `/tags/${item.id}` - ) - ) - collapse(); + navigateToRoute( + item.type === "notebook" + ? `/notebooks/${item.id}` + : `/tags/${item.id}` + ); + collapse(); }} > @@ -969,7 +969,6 @@ function navigateToRoute(path: string) { } useAppStore.getState().toggleListPane(); navigate(path); - return true; } export function collapseNavPaneHoveredIfNavPaneCollapsed() {