@@ -3,15 +3,17 @@ import { Tabs } from 'expo-router';
33import { NativeTabs , Icon , Label , VectorIcon } from 'expo-router/unstable-native-tabs' ;
44import Ionicons from '@expo/vector-icons/Ionicons' ;
55import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons' ;
6- import { Platform } from 'react-native' ;
6+ import { Image , Platform , View } from 'react-native' ;
77import { useTheme } from '../../src/theme/ThemeProvider' ;
88import { useAuthGuard } from '../../src/hooks/useAuthGuard' ;
99import useDeviceType from '../../src/hooks/useDeviceType' ;
1010import { useNavigation } from '../../src/context/NavigationContext' ;
11+ import { useUser } from '@clerk/expo' ;
1112
1213export default function TabLayout ( ) {
1314 const { isDark } = useTheme ( ) ;
1415 const { isLoaded } = useAuthGuard ( ) ;
16+ const { user } = useUser ( ) ;
1517 const deviceType = useDeviceType ( ) ;
1618 const { infotainmentLeftWidth, showInfotainmentMap } = useNavigation ( ) ;
1719
@@ -62,7 +64,9 @@ export default function TabLayout() {
6264
6365 [role="tablist"] a[href="/"]::after { content: "Home"; }
6466 [role="tablist"] a[href="/systems"]::after { content: "Systems"; }
67+ [role="tablist"] a[href="/classic-dashboard"]::after { content: "Classic"; }
6568 [role="tablist"] a[href="/signal-search"]::after { content: "Signals"; }
69+ [role="tablist"] a[href="/account"]::after { content: "Account"; }
6670 [role="tablist"] a[href="/profile"]::after { content: "Settings"; }
6771
6872 [role="tablist"] a::after {
@@ -208,9 +212,17 @@ export default function TabLayout() {
208212 name = "index"
209213 options = { {
210214 title : 'Home' ,
215+ unmountOnBlur : true ,
211216 tabBarIcon : ( { color, size } ) => < Ionicons name = "home" size = { isDesktopSidebar ? 22 : size } color = { color } /> ,
212217 } }
213218 />
219+ < Tabs . Screen
220+ name = "classic-dashboard"
221+ options = { {
222+ title : 'Classic' ,
223+ tabBarIcon : ( { color, size } ) => < Ionicons name = "speedometer-outline" size = { isDesktopSidebar ? 22 : size } color = { color } /> ,
224+ } }
225+ />
214226 < Tabs . Screen
215227 name = "systems"
216228 options = { {
@@ -225,6 +237,40 @@ export default function TabLayout() {
225237 tabBarIcon : ( { color, size } ) => < MaterialCommunityIcons name = "signal-variant" size = { isDesktopSidebar ? 22 : size } color = { color } /> ,
226238 } }
227239 />
240+ < Tabs . Screen
241+ name = "account"
242+ options = { {
243+ title : 'Account' ,
244+ tabBarItemStyle : isDesktopSidebar ? { marginTop : 'auto' } : undefined ,
245+ tabBarIcon : ( { color, size } ) =>
246+ user ?. imageUrl ? (
247+ < Image
248+ source = { { uri : user . imageUrl } }
249+ style = { {
250+ width : isDesktopSidebar ? 24 : size ,
251+ height : isDesktopSidebar ? 24 : size ,
252+ borderRadius : 999 ,
253+ borderWidth : 1 ,
254+ borderColor : color ,
255+ } }
256+ />
257+ ) : (
258+ < View
259+ style = { {
260+ width : isDesktopSidebar ? 24 : size ,
261+ height : isDesktopSidebar ? 24 : size ,
262+ borderRadius : 999 ,
263+ borderWidth : 1 ,
264+ borderColor : color ,
265+ alignItems : 'center' ,
266+ justifyContent : 'center' ,
267+ } }
268+ >
269+ < Ionicons name = "person" size = { isDesktopSidebar ? 14 : Math . max ( 12 , size - 6 ) } color = { color } />
270+ </ View >
271+ ) ,
272+ } }
273+ />
228274 < Tabs . Screen
229275 name = "profile"
230276 options = { {
@@ -264,6 +310,14 @@ export default function TabLayout() {
264310 } ) }
265311 </ NativeTabs . Trigger >
266312
313+ < NativeTabs . Trigger name = "classic-dashboard" >
314+ < Label > Classic</ Label >
315+ { Platform . select ( {
316+ ios : < Icon sf = { { default : 'speedometer' , selected : 'speedometer' } } /> ,
317+ android : < Icon src = { < VectorIcon family = { Ionicons } name = "speedometer-outline" /> } /> ,
318+ } ) }
319+ </ NativeTabs . Trigger >
320+
267321 < NativeTabs . Trigger name = "systems" >
268322 < Label > Systems</ Label >
269323 { Platform . select ( {
@@ -280,6 +334,14 @@ export default function TabLayout() {
280334 } ) }
281335 </ NativeTabs . Trigger >
282336
337+ < NativeTabs . Trigger name = "account" >
338+ < Label > Account</ Label >
339+ { Platform . select ( {
340+ ios : < Icon sf = { { default : 'person.circle' , selected : 'person.circle.fill' } } /> ,
341+ android : < Icon src = { < VectorIcon family = { Ionicons } name = "person-circle" /> } /> ,
342+ } ) }
343+ </ NativeTabs . Trigger >
344+
283345 < NativeTabs . Trigger name = "profile" >
284346 < Label > Settings</ Label >
285347 { Platform . select ( {
0 commit comments