Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created April 25, 2021 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllGistsEqual/2200b3843188c6a2e89e402d3c5f919d to your computer and use it in GitHub Desktop.
Save AllGistsEqual/2200b3843188c6a2e89e402d3c5f919d to your computer and use it in GitHub Desktop.
// File: src/routing/MainNavigation.tsx
// (partial)
const MainNavigation = (): React.ReactElement => {
const isLoggedIn = useReduxSelector(selectLogin)
return (
<NavigationContainer>
<MainStack.Navigator headerMode="none">
{isLoggedIn ? (
<>
<MainStack.Screen name={MainRoutes.AppLoading} component={AppLoadingScreen} />
<MainStack.Screen name={MainRoutes.Home} component={HomeScreen} />
<MainStack.Screen name={MainRoutes.Settings} component={SettingsScreen} />
</>
) : (
<>
<MainStack.Screen name={MainRoutes.Splash} component={SplashScreen} />
<MainStack.Screen name={MainRoutes.AppCheck} component={AppCheckScreen} />
<MainStack.Screen name={MainRoutes.SignIn} component={SignInScreen} />
<MainStack.Screen name={MainRoutes.SignUp} component={SignUpScreen} />
</>
)}
</MainStack.Navigator>
</NavigationContainer>
)
}
export default MainNavigation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment