| 1 | import { Image } from 'expo-image';
|
| 2 | import { Platform, StyleSheet } from 'react-native';
|
| 3 |
|
| 4 | import { HelloWave } from '@/components/hello-wave';
|
| 5 | import ParallaxScrollView from '@/components/parallax-scroll-view';
|
| 6 | import { ThemedText } from '@/components/themed-text';
|
| 7 | import { ThemedView } from '@/components/themed-view';
|
| 8 | import { Link } from 'expo-router';
|
| 9 |
|
| 10 | export default function HomeScreen() {
|
| 11 | return (
|
| 12 | <ParallaxScrollView
|
| 13 | headerBackgroundColor={{ light: '#A1CEDC', dark: '#1D3D47' }}
|
| 14 | headerImage={
|
| 15 | <Image
|
| 16 | source={require('@/assets/images/partial-react-logo.png')}
|
| 17 | style={styles.reactLogo}
|
| 18 | />
|
| 19 | }>
|
| 20 | <ThemedView style={styles.titleContainer}>
|
| 21 | <ThemedText type="title">Welcome!</ThemedText>
|
| 22 | <HelloWave />
|
| 23 | </ThemedView>
|
| 24 | <ThemedView style={styles.stepContainer}>
|
| 25 | <ThemedText type="subtitle">Step 1: Try it</ThemedText>
|
| 26 | <ThemedText>
|
| 27 | Edit <ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> to see changes.
|
| 28 | Press{' '}
|
| 29 | <ThemedText type="defaultSemiBold">
|
| 30 | {Platform.select({
|
| 31 | ios: 'cmd + d',
|
| 32 | android: 'cmd + m',
|
| 33 | web: 'F12',
|
| 34 | })}
|
| 35 | </ThemedText>{' '}
|
| 36 | to open developer tools.
|
| 37 | </ThemedText>
|
| 38 | </ThemedView>
|
| 39 | <ThemedView style={styles.stepContainer}>
|
| 40 | <Link href="/modal">
|
| 41 | <Link.Trigger>
|
| 42 | <ThemedText type="subtitle">Step 2: Explore</ThemedText>
|
| 43 | </Link.Trigger>
|
| 44 | <Link.Preview />
|
| 45 | <Link.Menu>
|
| 46 | <Link.MenuAction title="Action" icon="cube" onPress={() => alert('Action pressed')} />
|
| 47 | <Link.MenuAction
|
| 48 | title="Share"
|
| 49 | icon="square.and.arrow.up"
|
| 50 | onPress={() => alert('Share pressed')}
|
| 51 | />
|
| 52 | <Link.Menu title="More" icon="ellipsis">
|
| 53 | <Link.MenuAction
|
| 54 | title="Delete"
|
| 55 | icon="trash"
|
| 56 | destructive
|
| 57 | onPress={() => alert('Delete pressed')}
|
| 58 | />
|
| 59 | </Link.Menu>
|
| 60 | </Link.Menu>
|
| 61 | </Link>
|
| 62 |
|
| 63 | <ThemedText>
|
| 64 | {`Tap the Explore tab to learn more about what's included in this starter app.`}
|
| 65 | </ThemedText>
|
| 66 | </ThemedView>
|
| 67 | <ThemedView style={styles.stepContainer}>
|
| 68 | <ThemedText type="subtitle">Step 3: Get a fresh start</ThemedText>
|
| 69 | <ThemedText>
|
| 70 | {`When you're ready, run `}
|
| 71 | <ThemedText type="defaultSemiBold">npm run reset-project</ThemedText> to get a fresh{' '}
|
| 72 | <ThemedText type="defaultSemiBold">app</ThemedText> directory. This will move the current{' '}
|
| 73 | <ThemedText type="defaultSemiBold">app</ThemedText> to{' '}
|
| 74 | <ThemedText type="defaultSemiBold">app-example</ThemedText>.
|
| 75 | </ThemedText>
|
| 76 | </ThemedView>
|
| 77 | </ParallaxScrollView>
|
| 78 | );
|
| 79 | }
|
| 80 |
|
| 81 | const styles = StyleSheet.create({
|
| 82 | titleContainer: {
|
| 83 | flexDirection: 'row',
|
| 84 | alignItems: 'center',
|
| 85 | gap: 8,
|
| 86 | },
|
| 87 | stepContainer: {
|
| 88 | gap: 8,
|
| 89 | marginBottom: 8,
|
| 90 | },
|
| 91 | reactLogo: {
|
| 92 | height: 178,
|
| 93 | width: 290,
|
| 94 | bottom: 0,
|
| 95 | left: 0,
|
| 96 | position: 'absolute',
|
| 97 | },
|
| 98 | });
|