Keine Beschreibung

App.tsx 2.8KB

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