Squash merge feat/expo-app: app-expo, .cursor, workflows, package.json, .husky; remove app-android, app-ios, react-app
This commit is contained in:
23
app-expo/src/app/(main)/_layout.tsx
Normal file
23
app-expo/src/app/(main)/_layout.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Redirect, Stack } from 'expo-router';
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, View } from 'react-native';
|
||||
|
||||
import { useSession } from '@/features/auth/hooks';
|
||||
|
||||
export default function MainLayout() {
|
||||
const { status } = useSession();
|
||||
|
||||
if (status === 'loading') {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<ActivityIndicator size="large" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
if (status === 'unauthenticated') {
|
||||
return <Redirect href="/(auth)/login" />;
|
||||
}
|
||||
|
||||
return <Stack screenOptions={{ headerShown: false }} />;
|
||||
}
|
||||
Reference in New Issue
Block a user