freshyo/apps/user-ui/app/(auth)/_layout.tsx
2026-01-24 00:13:15 +05:30

20 lines
No EOL
540 B
TypeScript

import { Stack, Redirect } from 'expo-router';
import { View, ActivityIndicator } from 'react-native';
import { tw } from 'common-ui';
import { useAuth } from '@/src/contexts/AuthContext';
export default function AuthLayout() {
const { isAuthenticated, isLoading } = useAuth();
if (isLoading) {
return (
<View style={tw`flex-1 justify-center items-center bg-white`}>
<ActivityIndicator size="large" color="#3B82F6" />
</View>
);
}
return (
<Stack screenOptions={{ headerShown: false }} />
);
}