Add onboarding screen + token check
This commit is contained in:
parent
b951d0a0bc
commit
f5c59f602a
19 changed files with 433 additions and 279 deletions
31
app/index.tsx
Normal file
31
app/index.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import {Redirect, Stack} from 'expo-router';
|
||||
import {StyleSheet, Text, TextInput, TouchableOpacity} from 'react-native';
|
||||
|
||||
import {ThemedText} from '@/components/ThemedText';
|
||||
import {ThemedView} from '@/components/ThemedView';
|
||||
import {useToken} from '@/context/AppProvider';
|
||||
import {Colors} from '@/constants/Colors';
|
||||
import React, {useEffect} from 'react';
|
||||
import {useColorScheme} from '@/hooks/useColorScheme';
|
||||
import {Message} from '@/services/message';
|
||||
import {Request} from '@/services/request';
|
||||
import { router } from 'expo-router';
|
||||
|
||||
export default function OnboardStartScreen() {
|
||||
const {token, isLoading} = useToken();
|
||||
|
||||
// You can keep the splash screen open, or render a loading screen like we do here.
|
||||
if (isLoading) {
|
||||
return (
|
||||
<ThemedView>
|
||||
<ThemedText>Laden...</ThemedText>
|
||||
</ThemedView>
|
||||
);
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
return <Redirect href="/(onboarding)/start"/>;
|
||||
}
|
||||
|
||||
return <Redirect href="/(tabs)"/>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue