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