fix: subscription tab not highlighted on detail pages

isActive used exact pathname match (===), so navigating to
/subscriptions/:id or /subscriptions/:id/renew would not highlight
the Subscription tab. Changed to startsWith for non-root paths
in both MobileBottomNav and DesktopSidebar.
This commit is contained in:
Fringg
2026-04-02 05:44:06 +03:00
parent fe609a505b
commit e2f81ad28d
2 changed files with 4 additions and 2 deletions

View File

@@ -74,7 +74,8 @@ export function DesktopSidebar({
const hasCustomLogo = branding?.has_custom_logo || false;
const logoUrl = branding ? brandingApi.getLogoUrl(branding) : null;
const isActive = (path: string) => location.pathname === path;
const isActive = (path: string) =>
path === '/' ? location.pathname === '/' : location.pathname.startsWith(path);
const isAdminActive = () => location.pathname.startsWith('/admin');
const navItems = [

View File

@@ -23,7 +23,8 @@ export function MobileBottomNav({
const location = useLocation();
const { haptic } = usePlatform();
const isActive = (path: string) => location.pathname === path;
const isActive = (path: string) =>
path === '/' ? location.pathname === '/' : location.pathname.startsWith(path);
// Core navigation items for bottom bar
// When wheel is enabled, it replaces Support in the bottom nav (Support is still accessible via hamburger menu)