freshyo/apps/user-ui/app/index.tsx
2026-01-24 00:13:15 +05:30

22 lines
No EOL
647 B
TypeScript
Executable file

import { Redirect } from 'expo-router';
import { useAuth } from '@/src/contexts/AuthContext';
import { View, ActivityIndicator } from 'react-native';
import { tw, AppContainer } from 'common-ui';
export default function Index() {
const { isAuthenticated, isLoading } = useAuth();
if (isLoading) {
return (
<AppContainer>
<View style={tw`flex-1 justify-center items-center`}>
<ActivityIndicator size="large" color="#3B82F6" />
</View>
</AppContainer>
);
}
console.log("from the user ui index.tsx - isAuthenticated:", isAuthenticated);
return <Redirect href="/(drawer)/(tabs)/home" />;
}