App.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. *
  5. * @format
  6. * @flow
  7. */
  8. import React from 'react';
  9. import {
  10. SafeAreaView,
  11. StyleSheet,
  12. ScrollView,
  13. View,
  14. Text,
  15. StatusBar,
  16. } from 'react-native';
  17. import {
  18. Header,
  19. LearnMoreLinks,
  20. Colors,
  21. DebugInstructions,
  22. ReloadInstructions,
  23. } from 'react-native/Libraries/NewAppScreen';
  24. const App: () => React$Node = () => {
  25. return (
  26. <>
  27. <StatusBar barStyle="dark-content" />
  28. <SafeAreaView>
  29. <ScrollView
  30. contentInsetAdjustmentBehavior="automatic"
  31. style={styles.scrollView}>
  32. <Header />
  33. {global.HermesInternal == null ? null : (
  34. <View style={styles.engine}>
  35. <Text style={styles.footer}>Engine: Hermes</Text>
  36. </View>
  37. )}
  38. <View style={styles.body}>
  39. <View style={styles.sectionContainer}>
  40. <Text style={styles.sectionTitle}>Step One</Text>
  41. <Text style={styles.sectionDescription}>
  42. Edit <Text style={styles.highlight}>App.js</Text> to change this
  43. screen and then come back to see your edits.
  44. </Text>
  45. </View>
  46. <View style={styles.sectionContainer}>
  47. <Text style={styles.sectionTitle}>See Your Changes</Text>
  48. <Text style={styles.sectionDescription}>
  49. <ReloadInstructions />
  50. </Text>
  51. </View>
  52. <View style={styles.sectionContainer}>
  53. <Text style={styles.sectionTitle}>Debug</Text>
  54. <Text style={styles.sectionDescription}>
  55. <DebugInstructions />
  56. </Text>
  57. </View>
  58. <View style={styles.sectionContainer}>
  59. <Text style={styles.sectionTitle}>Learn More</Text>
  60. <Text style={styles.sectionDescription}>
  61. Read the docs to discover what to do next:
  62. </Text>
  63. </View>
  64. <LearnMoreLinks />
  65. </View>
  66. </ScrollView>
  67. </SafeAreaView>
  68. </>
  69. );
  70. };
  71. const styles = StyleSheet.create({
  72. scrollView: {
  73. backgroundColor: Colors.lighter,
  74. },
  75. engine: {
  76. position: 'absolute',
  77. right: 0,
  78. },
  79. body: {
  80. backgroundColor: Colors.white,
  81. },
  82. sectionContainer: {
  83. marginTop: 32,
  84. paddingHorizontal: 24,
  85. },
  86. sectionTitle: {
  87. fontSize: 24,
  88. fontWeight: '600',
  89. color: Colors.black,
  90. },
  91. sectionDescription: {
  92. marginTop: 8,
  93. fontSize: 18,
  94. fontWeight: '400',
  95. color: Colors.dark,
  96. },
  97. highlight: {
  98. fontWeight: '700',
  99. },
  100. footer: {
  101. color: Colors.dark,
  102. fontSize: 12,
  103. fontWeight: '600',
  104. padding: 4,
  105. paddingRight: 12,
  106. textAlign: 'right',
  107. },
  108. });
  109. export default App;