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