Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: selectedRoute does not highlight

thecodrre3f3931e7b49
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index a714e4e87..dd02df2da 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -108,7 +108,11 @@ function NavigationMenu(props) {
key={item.path}
title={item.title}
icon={item.icon}
- selected={selectedRoute === item.path}
+ selected={
+ item.path === "/"
+ ? selectedRoute === item.path
+ : selectedRoute.startsWith(item.path)
+ }
onClick={() => {
setSelectedRoute(item.path);
if (selectedRoute === item.path)
@@ -171,9 +175,9 @@ function NavigationMenu(props) {
icon={item.icon}
onClick={() => {
navigate(item.path);
- setSelectedRoute(item.key);
+ setSelectedRoute(item.path);
}}
- selected={selectedRoute === item.path}
+ selected={selectedRoute.startsWith(item.path)}
/>
))}
</Flex>