index.tsx 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { Image } from 'expo-image';
  2. import { Platform, StyleSheet } from 'react-native';
  3. import { HelloWave } from '@/components/HelloWave';
  4. import ParallaxScrollView from '@/components/ParallaxScrollView';
  5. import { ThemedText } from '@/components/ThemedText';
  6. import { ThemedView } from '@/components/ThemedView';
  7. export default function HomeScreen() {
  8. return (
  9. <ParallaxScrollView
  10. headerBackgroundColor={{ light: '#A1CEDC', dark: '#1D3D47' }}
  11. headerImage={
  12. <Image
  13. source={require('@/assets/images/partial-react-logo.png')}
  14. style={styles.reactLogo}
  15. />
  16. }>
  17. <ThemedView style={styles.titleContainer}>
  18. <ThemedText type="title">Welcome!</ThemedText>
  19. <HelloWave />
  20. </ThemedView>
  21. <ThemedView style={styles.stepContainer}>
  22. <ThemedText type="subtitle">Step 1: Try it</ThemedText>
  23. <ThemedText>
  24. Edit <ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> to see changes.
  25. Press{' '}
  26. <ThemedText type="defaultSemiBold">
  27. {Platform.select({
  28. ios: 'cmd + d',
  29. android: 'cmd + m',
  30. web: 'F12',
  31. })}
  32. </ThemedText>{' '}
  33. to open developer tools.
  34. </ThemedText>
  35. </ThemedView>
  36. <ThemedView style={styles.stepContainer}>
  37. <ThemedText type="subtitle">Step 2: Explore</ThemedText>
  38. <ThemedText>
  39. {`Tap the Explore tab to learn more about what's included in this starter app.`}
  40. </ThemedText>
  41. </ThemedView>
  42. <ThemedView style={styles.stepContainer}>
  43. <ThemedText type="subtitle">Step 3: Get a fresh start</ThemedText>
  44. <ThemedText>
  45. {`When you're ready, run `}
  46. <ThemedText type="defaultSemiBold">npm run reset-project</ThemedText> to get a fresh{' '}
  47. <ThemedText type="defaultSemiBold">app</ThemedText> directory. This will move the current{' '}
  48. <ThemedText type="defaultSemiBold">app</ThemedText> to{' '}
  49. <ThemedText type="defaultSemiBold">app-example</ThemedText>.
  50. </ThemedText>
  51. </ThemedView>
  52. </ParallaxScrollView>
  53. );
  54. }
  55. const styles = StyleSheet.create({
  56. titleContainer: {
  57. flexDirection: 'row',
  58. alignItems: 'center',
  59. gap: 8,
  60. },
  61. stepContainer: {
  62. gap: 8,
  63. marginBottom: 8,
  64. },
  65. reactLogo: {
  66. height: 178,
  67. width: 290,
  68. bottom: 0,
  69. left: 0,
  70. position: 'absolute',
  71. },
  72. });