- Added unit and end-to-end testing scripts to package.json. - Included detox for end-to-end testing and jest-circus for improved test execution. feat: add testID to LandingScreen logo for better testing - Added testID attribute to the logo image in LandingScreen for easier identification in tests. feat: create tokens.ts to re-export design tokens - Introduced tokens.ts to re-export shared design tokens from lightTheme for consistent imports.
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
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"
|
|
testID="landing-logo"
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
},
|
|
logo: {
|
|
width: 220,
|
|
height: 220,
|
|
},
|
|
}); |