From e2f81ad28dd5caaee8d5b5a0796b4b78a6c36ace Mon Sep 17 00:00:00 2001 From: Fringg Date: Thu, 2 Apr 2026 05:44:06 +0300 Subject: [PATCH] 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. --- src/components/layout/AppShell/DesktopSidebar.tsx | 3 ++- src/components/layout/AppShell/MobileBottomNav.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/layout/AppShell/DesktopSidebar.tsx b/src/components/layout/AppShell/DesktopSidebar.tsx index 1f38940..7799435 100644 --- a/src/components/layout/AppShell/DesktopSidebar.tsx +++ b/src/components/layout/AppShell/DesktopSidebar.tsx @@ -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 = [ diff --git a/src/components/layout/AppShell/MobileBottomNav.tsx b/src/components/layout/AppShell/MobileBottomNav.tsx index 9d72221..f143787 100644 --- a/src/components/layout/AppShell/MobileBottomNav.tsx +++ b/src/components/layout/AppShell/MobileBottomNav.tsx @@ -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)