@@ -9,6 +9,15 @@ import { useAuthGuard } from '../../src/hooks/useAuthGuard';
99import useDeviceType from '../../src/hooks/useDeviceType' ;
1010import { useNavigation } from '../../src/context/NavigationContext' ;
1111import { useUser } from '@clerk/expo' ;
12+ import { getExpoWebBasePath } from '../../src/lib/expoWebBasePath' ;
13+
14+ /** Href segment for Expo Router tab links (with optional GitHub Pages `experiments.baseUrl`). */
15+ function tabHref ( pathFromRoot ) {
16+ const base = getExpoWebBasePath ( ) ;
17+ const p = pathFromRoot . startsWith ( '/' ) ? pathFromRoot : `/${ pathFromRoot } ` ;
18+ if ( ! base ) return p ;
19+ return `${ base } ${ p } ` . replace ( / \/ { 2 , } / g, '/' ) ;
20+ }
1221
1322export default function TabLayout ( ) {
1423 const { isDark } = useTheme ( ) ;
@@ -37,6 +46,18 @@ export default function TabLayout() {
3746 if ( document . getElementById ( styleId ) ) return ;
3847 const style = document . createElement ( 'style' ) ;
3948 style . id = styleId ;
49+ const base = getExpoWebBasePath ( ) ;
50+ const homeSelectors = base
51+ ? `[role="tablist"] a[href="${ base } "]::after, [role="tablist"] a[href="${ base } /"]::after`
52+ : `[role="tablist"] a[href="/"]::after` ;
53+ const tabRules = [
54+ `${ homeSelectors } { content: "Home"; }` ,
55+ `[role="tablist"] a[href="${ tabHref ( '/systems' ) } "]::after { content: "Systems"; }` ,
56+ `[role="tablist"] a[href="${ tabHref ( '/classic-dashboard' ) } "]::after { content: "Classic"; }` ,
57+ `[role="tablist"] a[href="${ tabHref ( '/signal-search' ) } "]::after { content: "Signals"; }` ,
58+ `[role="tablist"] a[href="${ tabHref ( '/account' ) } "]::after { content: "Account"; }` ,
59+ `[role="tablist"] a[href="${ tabHref ( '/profile' ) } "]::after { content: "Settings"; }` ,
60+ ] . join ( '\n ' ) ;
4061 style . textContent = `
4162 [role="tablist"] {
4263 flex-direction: column !important;
@@ -65,12 +86,7 @@ export default function TabLayout() {
6586 position: relative !important;
6687 }
6788
68- [role="tablist"] a[href="/"]::after { content: "Home"; }
69- [role="tablist"] a[href="/systems"]::after { content: "Systems"; }
70- [role="tablist"] a[href="/classic-dashboard"]::after { content: "Classic"; }
71- [role="tablist"] a[href="/signal-search"]::after { content: "Signals"; }
72- [role="tablist"] a[href="/account"]::after { content: "Account"; }
73- [role="tablist"] a[href="/profile"]::after { content: "Settings"; }
89+ ${ tabRules }
7490
7591 [role="tablist"] a::after {
7692 display: block !important;
0 commit comments