EditScreenInfo.tsx 2.8 KB

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