diff --git a/src/components/layout/BottomNav.vue b/src/components/layout/BottomNav.vue index c27ef7a..e23fd98 100644 --- a/src/components/layout/BottomNav.vue +++ b/src/components/layout/BottomNav.vue @@ -17,6 +17,11 @@ export interface BottomTab { /** Render the entry ghosted (opacity-reduced). Used for coming-soon and * for auth-required tabs when the user is logged out. */ disabled?: boolean + /** Per-tab active-state override for entries whose active condition + * doesn't reduce to "current route starts with this.path" — e.g. a + * "Hosting" tab that is active when a feed-filter ref is on. When + * set it wins over the App-level `isActive(path)` matcher. */ + isActive?: () => boolean } interface Props { @@ -37,6 +42,11 @@ function onTabClick(tab: BottomTab) { } if (tab.path) router.push(tab.path) } + +function isTabActive(tab: BottomTab): boolean { + if (tab.isActive) return tab.isActive() + return !!tab.path && props.isActive(tab.path) +}