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