From d9361c11fc06b434d2848214d6b64ecc57012853 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Fri, 6 Sep 2024 15:13:44 +0800 Subject: [PATCH] dashboard: fix route path (#1009) * fix route path Signed-off-by: Teo Koon Peng * show not found page when page not found under baseurl Signed-off-by: Teo Koon Peng --------- Signed-off-by: Teo Koon Peng --- packages/dashboard/src/components/rmf-dashboard.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/dashboard/src/components/rmf-dashboard.tsx b/packages/dashboard/src/components/rmf-dashboard.tsx index feb40bd8a..471e713ad 100644 --- a/packages/dashboard/src/components/rmf-dashboard.tsx +++ b/packages/dashboard/src/components/rmf-dashboard.tsx @@ -275,7 +275,7 @@ function DashboardContents({ extraAppbarItems, }: DashboardContentsProps) { const location = useLocation(); - const currentTab = tabs.find((t) => matchPath(t.route, location.pathname)); + const currentTab = tabs.find((t) => matchPath(`${baseUrl}${t.route}`, location.pathname)); const [pendingTransition, startTransition] = useTransition(); const navigate = useNavigate(); @@ -335,6 +335,7 @@ function DashboardContents({ /> ))} + } /> } />