mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 20:10:58 +00:00
fixes
This commit is contained in:
@@ -46,9 +46,14 @@ export function AppSidebar({
|
||||
}: AppSidebarProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Prefer an exact `to` match so sibling routes sharing a path prefix
|
||||
// (e.g. /vessel-registration and /vessel-registration/transfer) don't
|
||||
// both light up. Prefix matching is the fallback, for sub-pages that
|
||||
// aren't themselves in the nav (e.g. /vessel-registration/apply).
|
||||
const exactMatch = navItems.find((i) => i.to === activePath);
|
||||
const activeNavItem = (item: NavItem) =>
|
||||
!!item.to &&
|
||||
(activePath === item.to || activePath.startsWith(`${item.to}/`));
|
||||
(exactMatch ? item === exactMatch : activePath.startsWith(`${item.to}/`));
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user