fitst commit
This commit is contained in:
21
app/index.tsx
Normal file
21
app/index.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { useAuth } from '@/components/AuthProvider';
|
||||
import { Redirect } from 'expo-router';
|
||||
import { ActivityIndicator, View } from 'react-native';
|
||||
|
||||
export default function Index() {
|
||||
const { isAuthenticated, isLoading } = useAuth();
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<ActivityIndicator size="large" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Redirect href="/(dashboard)" />;
|
||||
}
|
||||
|
||||
return <Redirect href="/(auth)" />;
|
||||
}
|
||||
Reference in New Issue
Block a user