You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

explore.tsx 4.4KB

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