Created
June 23, 2021 11:27
-
-
Save alanfoandrade/17754f7d0ad01ffed623a6ccc1d35a00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { createStackNavigator } from '@react-navigation/stack'; | |
import { useAuth } from '../hooks/auth'; | |
import AuthRoutes from './auth.routes'; | |
import AppRoutes from './app.routes'; | |
const Stack = createStackNavigator(); | |
const Routes: React.FC = () => { | |
const { user } = useAuth(); | |
return user ? ( | |
<Stack.Navigator> | |
<Stack.Screen | |
name="AppRoutes" | |
component={AppRoutes} | |
options={{ | |
headerShown: false, | |
}} | |
/> | |
</Stack.Navigator> | |
) : ( | |
<Stack.Navigator> | |
<Stack.Screen | |
name="AuthRoutes" | |
component={AuthRoutes} | |
options={{ | |
headerShown: false, | |
}} | |
/> | |
</Stack.Navigator> | |
); | |
}; | |
export default Routes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment