mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
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:
@@ -74,7 +74,8 @@ export function DesktopSidebar({
|
|||||||
const hasCustomLogo = branding?.has_custom_logo || false;
|
const hasCustomLogo = branding?.has_custom_logo || false;
|
||||||
const logoUrl = branding ? brandingApi.getLogoUrl(branding) : null;
|
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 isAdminActive = () => location.pathname.startsWith('/admin');
|
||||||
|
|
||||||
const navItems = [
|
const navItems = [
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ export function MobileBottomNav({
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { haptic } = usePlatform();
|
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
|
// Core navigation items for bottom bar
|
||||||
// When wheel is enabled, it replaces Support in the bottom nav (Support is still accessible via hamburger menu)
|
// When wheel is enabled, it replaces Support in the bottom nav (Support is still accessible via hamburger menu)
|
||||||
|
|||||||
Reference in New Issue
Block a user