File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import React, {useState, useContext} from 'react';
import {AuthContext} from '../context/AuthContext';
import StartLoading from '../screens/StartLoading';
import {NavigationContainer} from '@react-navigation/native';
import DrawerNavigate from './DrawerNavigate';
import AuthStack from './AuthStack';
export default function AppNav() {
const {userToken} = useContext(AuthContext);
const [isLoading, setIsLoading] = useState(true);
setTimeout(() => {
setIsLoading(false);
}, 3000);
return (
<NavigationContainer>
{isLoading ? (
<StartLoading />
) : userToken !== null ? (
<DrawerNavigate />
) : (
<AuthStack />
)}
</NavigationContainer>
);
}