| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import { Stack } from 'expo-router/stack';
- import AuthProvider, { useAuth } from '../context/AuthProvider';
- import { EXPO_PUBLIC_NODE_ENV } from '@env';
- import * as SecureStore from 'expo-secure-store';
- import { GestureHandlerRootView } from 'react-native-gesture-handler';
- import { useEffect, useState } from 'react';
- import { ActivityIndicator, View } from 'react-native';
- import { checkVersion } from '../component/checkVersion';
- import { authenticationService } from '../service/authService';
- export default function RootLayout() {
- const [isLoading, setIsLoading] = useState(true);
- const { user } = useAuth();
- // useEffect(() => {
- // const fetchVersion = async () => {
- // const response = await authenticationService.getVersion();
- // console.log('response', response);
- // checkVersion(response);
- // };
- // fetchVersion();
- // }, []);
- return (
- <GestureHandlerRootView style={{ flex: 1 }}>
- <AuthProvider>
- <Stack>
- <Stack.Screen name="(auth)/(tabs)" options={{ headerShown: false }} />
- <Stack.Screen name="(public)/login" options={{ headerShown: false }} />
- <Stack.Screen name="(public)/registerChooseVehiclesOne" options={{ headerShown: false }} />
- <Stack.Screen name="(public)/registerChooseVehiclesTwo" options={{ headerShown: false }} />
- {/* Testing Purpose */}
- {EXPO_PUBLIC_NODE_ENV == 'development' ? (
- <Stack.Screen
- name="(public)/test"
- options={{
- headerShown: false,
- title: 'Test Component Page'
- }}
- />
- ) : (
- <></>
- )}
- </Stack>
- </AuthProvider>
- </GestureHandlerRootView>
- );
- }
|