_layout.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Stack } from 'expo-router/stack';
  2. import AuthProvider, { useAuth } from '../context/AuthProvider';
  3. import { EXPO_PUBLIC_NODE_ENV } from '@env';
  4. import * as SecureStore from 'expo-secure-store';
  5. import { GestureHandlerRootView } from 'react-native-gesture-handler';
  6. import { useEffect, useState } from 'react';
  7. import { ActivityIndicator, View } from 'react-native';
  8. export default function RootLayout() {
  9. const [isLoading, setIsLoading] = useState(true);
  10. const { user } = useAuth();
  11. return (
  12. <GestureHandlerRootView style={{ flex: 1 }}>
  13. <AuthProvider>
  14. <Stack>
  15. <Stack.Screen name="(auth)/(tabs)" options={{ headerShown: false }} />
  16. <Stack.Screen name="(public)/login" options={{ headerShown: false }} />
  17. <Stack.Screen name="(public)/registerChooseVehiclesOne" options={{ headerShown: false }} />
  18. <Stack.Screen name="(public)/registerChooseVehiclesTwo" options={{ headerShown: false }} />
  19. {/* Testing Purpose */}
  20. {EXPO_PUBLIC_NODE_ENV == 'development' ? (
  21. <Stack.Screen
  22. name="(public)/test"
  23. options={{
  24. headerShown: false,
  25. title: 'Test Component Page'
  26. }}
  27. />
  28. ) : (
  29. <></>
  30. )}
  31. </Stack>
  32. </AuthProvider>
  33. </GestureHandlerRootView>
  34. );
  35. }