Fix routes for logged out users
This commit is contained in:
@@ -42,9 +42,7 @@ const Tab = createBottomTabNavigator<AppRouteParams & { Loading: never; Oops: ne
|
|||||||
|
|
||||||
const Tabs = () => {
|
const Tabs = () => {
|
||||||
return (
|
return (
|
||||||
<Tab.Navigator
|
<Tab.Navigator tabBar={ScaffoldMobileCC}>
|
||||||
tabBar={ScaffoldMobileCC}
|
|
||||||
>
|
|
||||||
{Object.entries(tabRoutes).map(([name, route], routeIndex) => (
|
{Object.entries(tabRoutes).map(([name, route], routeIndex) => (
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
key={'route-' + routeIndex}
|
key={'route-' + routeIndex}
|
||||||
@@ -292,11 +290,10 @@ export const Router = () => {
|
|||||||
return <LoadingView />;
|
return <LoadingView />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const routes = authStatus == 'authed' ? { ...protectedRoutes } : publicRoutes;
|
||||||
return (
|
return (
|
||||||
<NavigationContainer
|
<NavigationContainer
|
||||||
linking={routesToLinkingConfig(
|
linking={routesToLinkingConfig(routes)}
|
||||||
authStatus == 'authed' ? { ...protectedRoutes } : publicRoutes
|
|
||||||
)}
|
|
||||||
fallback={<LoadingView />}
|
fallback={<LoadingView />}
|
||||||
theme={colorScheme == 'light' ? DefaultTheme : DarkTheme}
|
theme={colorScheme == 'light' ? DefaultTheme : DarkTheme}
|
||||||
>
|
>
|
||||||
@@ -312,7 +309,7 @@ export const Router = () => {
|
|||||||
{routesToScreens(publicRoutes)}
|
{routesToScreens(publicRoutes)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
routesToScreens(protectedRoutes)
|
routesToScreens(routes)
|
||||||
)}
|
)}
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ pkgs.mkShell {
|
|||||||
nodePackages.prisma
|
nodePackages.prisma
|
||||||
nodePackages."@nestjs/cli"
|
nodePackages."@nestjs/cli"
|
||||||
nodePackages.npm
|
nodePackages.npm
|
||||||
|
nodePackages.eas-cli
|
||||||
eslint_d
|
eslint_d
|
||||||
nodejs_16
|
nodejs_18
|
||||||
yarn
|
yarn
|
||||||
(python3.withPackages (ps: with ps; [requests mido]))
|
(python3.withPackages (ps: with ps; [requests mido]))
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|||||||
Reference in New Issue
Block a user