Initial commit
This commit is contained in:
53
app/src/screens/LandingScreen.tsx
Normal file
53
app/src/screens/LandingScreen.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { Image, StyleSheet, View } from 'react-native';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
||||
|
||||
import { useTheme } from '../theme/ThemeProvider';
|
||||
import type { RootStackParamList } from '../navigation';
|
||||
|
||||
type NavigationProp = NativeStackNavigationProp<RootStackParamList, 'Landing'>;
|
||||
|
||||
export default function LandingScreen() {
|
||||
const { colors } = useTheme();
|
||||
const navigation = useNavigation<NavigationProp>();
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
navigation.reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{
|
||||
name: 'MainTabs',
|
||||
params: { screen: 'Models' },
|
||||
},
|
||||
],
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, [navigation]);
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: colors.background }]}>
|
||||
<Image
|
||||
source={require('../../assets/logo.png')}
|
||||
style={styles.logo}
|
||||
resizeMode="contain"
|
||||
accessibilityLabel="My Mobile Agent"
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
logo: {
|
||||
width: 220,
|
||||
height: 220,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user