Update route check and add PageBody wrapper

Updated the `isRouteActive` check in the sidebar component to ensure it doesn't falsely identify nested routes as active. Additionally, introduced a `PageBody` wrapper in the account page component for consistent styling and padding.
This commit is contained in:
giancarlo
2024-05-13 19:51:33 +07:00
parent 6ab4558691
commit a75009c0df
2 changed files with 8 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ export function SidebarItem({
const { collapsed } = useContext(SidebarContext);
const currentPath = usePathname() ?? '';
const active = isRouteActive(path, currentPath, end);
const active = isRouteActive(path, currentPath, end ?? false);
const variant = active ? 'secondary' : 'ghost';
const size = collapsed ? 'icon' : 'sm';
@@ -254,4 +254,4 @@ export function SidebarNavigation({
})}
</>
);
}
}