|
| 1 | +import * as WebBrowser from 'expo-web-browser'; |
| 2 | +import React from 'react'; |
| 3 | +import { StyleSheet, TouchableOpacity } from 'react-native'; |
| 4 | + |
| 5 | +import Colors from '../constants/Colors'; |
| 6 | +import { MonoText } from './StyledText'; |
| 7 | +import { Text, View } from './Themed'; |
| 8 | + |
| 9 | +export default function EditScreenInfo({ path }: { path: string }) { |
| 10 | + return ( |
| 11 | + <View> |
| 12 | + <View style={styles.getStartedContainer}> |
| 13 | + <Text |
| 14 | + style={styles.getStartedText} |
| 15 | + lightColor="rgba(0,0,0,0.8)" |
| 16 | + darkColor="rgba(255,255,255,0.8)"> |
| 17 | + Open up the code for this screen: |
| 18 | + </Text> |
| 19 | + |
| 20 | + <View |
| 21 | + style={[styles.codeHighlightContainer, styles.homeScreenFilename]} |
| 22 | + darkColor="rgba(255,255,255,0.05)" |
| 23 | + lightColor="rgba(0,0,0,0.05)"> |
| 24 | + <MonoText>{path}</MonoText> |
| 25 | + </View> |
| 26 | + |
| 27 | + <Text |
| 28 | + style={styles.getStartedText} |
| 29 | + lightColor="rgba(0,0,0,0.8)" |
| 30 | + darkColor="rgba(255,255,255,0.8)"> |
| 31 | + Change any of the text, save the file, and your app will automatically update. |
| 32 | + </Text> |
| 33 | + </View> |
| 34 | + |
| 35 | + <View style={styles.helpContainer}> |
| 36 | + <TouchableOpacity onPress={handleHelpPress} style={styles.helpLink}> |
| 37 | + <Text style={styles.helpLinkText} lightColor={Colors.light.tint}> |
| 38 | + Tap here if your app doesn't automatically update after making changes |
| 39 | + </Text> |
| 40 | + </TouchableOpacity> |
| 41 | + </View> |
| 42 | + </View> |
| 43 | + ); |
| 44 | +} |
| 45 | + |
| 46 | +function handleHelpPress() { |
| 47 | + WebBrowser.openBrowserAsync( |
| 48 | + 'https://docs.expo.io/get-started/create-a-new-app/#opening-the-app-on-your-phonetablet' |
| 49 | + ); |
| 50 | +} |
| 51 | + |
| 52 | +const styles = StyleSheet.create({ |
| 53 | + container: { |
| 54 | + flex: 1, |
| 55 | + backgroundColor: '#fff', |
| 56 | + }, |
| 57 | + developmentModeText: { |
| 58 | + marginBottom: 20, |
| 59 | + fontSize: 14, |
| 60 | + lineHeight: 19, |
| 61 | + textAlign: 'center', |
| 62 | + }, |
| 63 | + contentContainer: { |
| 64 | + paddingTop: 30, |
| 65 | + }, |
| 66 | + welcomeContainer: { |
| 67 | + alignItems: 'center', |
| 68 | + marginTop: 10, |
| 69 | + marginBottom: 20, |
| 70 | + }, |
| 71 | + welcomeImage: { |
| 72 | + width: 100, |
| 73 | + height: 80, |
| 74 | + resizeMode: 'contain', |
| 75 | + marginTop: 3, |
| 76 | + marginLeft: -10, |
| 77 | + }, |
| 78 | + getStartedContainer: { |
| 79 | + alignItems: 'center', |
| 80 | + marginHorizontal: 50, |
| 81 | + }, |
| 82 | + homeScreenFilename: { |
| 83 | + marginVertical: 7, |
| 84 | + }, |
| 85 | + codeHighlightText: { |
| 86 | + color: 'rgba(96,100,109, 0.8)', |
| 87 | + }, |
| 88 | + codeHighlightContainer: { |
| 89 | + borderRadius: 3, |
| 90 | + paddingHorizontal: 4, |
| 91 | + }, |
| 92 | + getStartedText: { |
| 93 | + fontSize: 17, |
| 94 | + lineHeight: 24, |
| 95 | + textAlign: 'center', |
| 96 | + }, |
| 97 | + helpContainer: { |
| 98 | + marginTop: 15, |
| 99 | + marginHorizontal: 20, |
| 100 | + alignItems: 'center', |
| 101 | + }, |
| 102 | + helpLink: { |
| 103 | + paddingVertical: 15, |
| 104 | + }, |
| 105 | + helpLinkText: { |
| 106 | + textAlign: 'center', |
| 107 | + }, |
| 108 | +}); |
0 commit comments