feat(mobile): replace starter template with dashboard-driven app flow
This commit is contained in:
36
MobileApp/app/index.tsx
Normal file
36
MobileApp/app/index.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Redirect } from 'expo-router';
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
||||
|
||||
import { useApp } from '@/src/app-context';
|
||||
|
||||
export default function IndexRoute() {
|
||||
const { ready, state } = useApp();
|
||||
|
||||
if (!ready) {
|
||||
return (
|
||||
<View style={styles.loading}>
|
||||
<ActivityIndicator color="#60a5fa" size="large" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
if (!state.session?.session) {
|
||||
return <Redirect href={'/auth' as any} />;
|
||||
}
|
||||
|
||||
if (!state.deviceToken) {
|
||||
return <Redirect href={'/onboarding' as any} />;
|
||||
}
|
||||
|
||||
return <Redirect href="/(tabs)" />;
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
loading: {
|
||||
flex: 1,
|
||||
backgroundColor: '#0a0a0c',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user