From d0667b8f396f3b101f521c8a2f4917a23dcc5c1f Mon Sep 17 00:00:00 2001 From: mutuajames Date: Tue, 4 Jul 2023 10:35:23 +0300 Subject: [PATCH] Add logic for matching urls --- app/src/components/page/Sidebar/utils.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/components/page/Sidebar/utils.tsx b/app/src/components/page/Sidebar/utils.tsx index 3e6ca57fe..6b683b47b 100644 --- a/app/src/components/page/Sidebar/utils.tsx +++ b/app/src/components/page/Sidebar/utils.tsx @@ -12,6 +12,9 @@ export function getActivePath(path: string, routes: Route[]) { let openKey: string | undefined; function mapPaths(menu: Route) { + // Check for matching url + if (menu.url && path.includes(menu.url)) activeKey = menu.key; + // Exact match if (path === menu.url) activeKey = menu.key; // Check if the menu has children if (menu.children) {