Simpler app container
This commit is contained in:
parent
7413d26587
commit
1e49d80bb4
|
@ -32,7 +32,6 @@ const SetUsernameStack = () => (
|
|||
);
|
||||
|
||||
// App
|
||||
const Stack = createStackNavigator();
|
||||
const App = React.memo(({ root }) => {
|
||||
if (!root || root === ROOT_BACKGROUND) {
|
||||
return null;
|
||||
|
@ -41,34 +40,12 @@ const App = React.memo(({ root }) => {
|
|||
return (
|
||||
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
|
||||
<NavigationContainer ref={Navigation.navigationRef} onNavigationStateChange={onNavigationStateChange}>
|
||||
<Stack.Navigator screenOptions={{ headerShown: false, animationEnabled: false }}>
|
||||
<>
|
||||
{root === ROOT_LOADING ? (
|
||||
<Stack.Screen
|
||||
name='AuthLoading'
|
||||
component={AuthLoadingView}
|
||||
/>
|
||||
) : null}
|
||||
{root === ROOT_OUTSIDE || root === ROOT_NEW_SERVER ? (
|
||||
<Stack.Screen
|
||||
name='OutsideStack'
|
||||
component={OutsideStack}
|
||||
/>
|
||||
) : null}
|
||||
{root === ROOT_INSIDE ? (
|
||||
<Stack.Screen
|
||||
name='InsideStack'
|
||||
component={InsideStack}
|
||||
/>
|
||||
) : null}
|
||||
{root === ROOT_SET_USERNAME ? (
|
||||
<Stack.Screen
|
||||
name='SetUsernameStack'
|
||||
component={SetUsernameStack}
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
</Stack.Navigator>
|
||||
<>
|
||||
{root === ROOT_LOADING ? <AuthLoadingView /> : null}
|
||||
{root === ROOT_OUTSIDE || root === ROOT_NEW_SERVER ? <OutsideStack /> : null}
|
||||
{root === ROOT_INSIDE ? <InsideStack /> : null}
|
||||
{root === ROOT_SET_USERNAME ? <SetUsernameStack /> : null}
|
||||
</>
|
||||
</NavigationContainer>
|
||||
</SafeAreaProvider>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue