explore.tsx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import { Image } from 'expo-image';
  2. import { Platform, StyleSheet } from 'react-native';
  3. import { Collapsible } from '@/components/Collapsible';
  4. import { ExternalLink } from '@/components/ExternalLink';
  5. import ParallaxScrollView from '@/components/ParallaxScrollView';
  6. import { ThemedText } from '@/components/ThemedText';
  7. import { ThemedView } from '@/components/ThemedView';
  8. import { IconSymbol } from '@/components/ui/IconSymbol';
  9. export default function TabTwoScreen() {
  10. return (
  11. <ParallaxScrollView
  12. headerBackgroundColor={{ light: '#D0D0D0', dark: '#353636' }}
  13. headerImage={
  14. <IconSymbol
  15. size={310}
  16. color="#808080"
  17. name="chevron.left.forwardslash.chevron.right"
  18. style={styles.headerImage}
  19. />
  20. }>
  21. <ThemedView style={styles.titleContainer}>
  22. <ThemedText type="title">Explore</ThemedText>
  23. </ThemedView>
  24. <ThemedText>This app includes example code to help you get started.</ThemedText>
  25. <Collapsible title="File-based routing">
  26. <ThemedText>
  27. This app has two screens:{' '}
  28. <ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{' '}
  29. <ThemedText type="defaultSemiBold">app/(tabs)/explore.tsx</ThemedText>
  30. </ThemedText>
  31. <ThemedText>
  32. The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{' '}
  33. sets up the tab navigator.
  34. </ThemedText>
  35. <ExternalLink href="https://docs.expo.dev/router/introduction">
  36. <ThemedText type="link">Learn more</ThemedText>
  37. </ExternalLink>
  38. </Collapsible>
  39. <Collapsible title="Android, iOS, and web support">
  40. <ThemedText>
  41. You can open this project on Android, iOS, and the web. To open the web version, press{' '}
  42. <ThemedText type="defaultSemiBold">w</ThemedText> in the terminal running this project.
  43. </ThemedText>
  44. </Collapsible>
  45. <Collapsible title="Images">
  46. <ThemedText>
  47. For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{' '}
  48. <ThemedText type="defaultSemiBold">@3x</ThemedText> suffixes to provide files for
  49. different screen densities
  50. </ThemedText>
  51. <Image source={require('@/assets/images/react-logo.png')} style={{ alignSelf: 'center' }} />
  52. <ExternalLink href="https://reactnative.dev/docs/images">
  53. <ThemedText type="link">Learn more</ThemedText>
  54. </ExternalLink>
  55. </Collapsible>
  56. <Collapsible title="Custom fonts">
  57. <ThemedText>
  58. Open <ThemedText type="defaultSemiBold">app/_layout.tsx</ThemedText> to see how to load{' '}
  59. <ThemedText style={{ fontFamily: 'SpaceMono' }}>
  60. custom fonts such as this one.
  61. </ThemedText>
  62. </ThemedText>
  63. <ExternalLink href="https://docs.expo.dev/versions/latest/sdk/font">
  64. <ThemedText type="link">Learn more</ThemedText>
  65. </ExternalLink>
  66. </Collapsible>
  67. <Collapsible title="Light and dark mode components">
  68. <ThemedText>
  69. This template has light and dark mode support. The{' '}
  70. <ThemedText type="defaultSemiBold">useColorScheme()</ThemedText> hook lets you inspect
  71. what the user&apos;s current color scheme is, and so you can adjust UI colors accordingly.
  72. </ThemedText>
  73. <ExternalLink href="https://docs.expo.dev/develop/user-interface/color-themes/">
  74. <ThemedText type="link">Learn more</ThemedText>
  75. </ExternalLink>
  76. </Collapsible>
  77. <Collapsible title="Animations">
  78. <ThemedText>
  79. This template includes an example of an animated component. The{' '}
  80. <ThemedText type="defaultSemiBold">components/HelloWave.tsx</ThemedText> component uses
  81. the powerful <ThemedText type="defaultSemiBold">react-native-reanimated</ThemedText>{' '}
  82. library to create a waving hand animation.
  83. </ThemedText>
  84. {Platform.select({
  85. ios: (
  86. <ThemedText>
  87. The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{' '}
  88. component provides a parallax effect for the header image.
  89. </ThemedText>
  90. ),
  91. })}
  92. </Collapsible>
  93. </ParallaxScrollView>
  94. );
  95. }
  96. const styles = StyleSheet.create({
  97. headerImage: {
  98. color: '#808080',
  99. bottom: -90,
  100. left: -35,
  101. position: 'absolute',
  102. },
  103. titleContainer: {
  104. flexDirection: 'row',
  105. gap: 8,
  106. },
  107. });