Bez popisu

App.tsx 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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
  22. barStyle="dark-content"
  23. translucent
  24. backgroundColor="rgba(0, 0, 0, 0.3)"
  25. />
  26. <SafeAreaView>
  27. {insets => (
  28. <ScrollView
  29. contentInsetAdjustmentBehavior="automatic"
  30. contentContainerStyle={{
  31. paddingTop: insets.top,
  32. paddingBottom: insets.bottom,
  33. }}
  34. style={styles.scrollView}
  35. >
  36. <Header />
  37. <View style={styles.body}>
  38. <View style={styles.sectionContainer}>
  39. <Text style={styles.sectionTitle}>Step One</Text>
  40. <Text style={styles.sectionDescription}>
  41. Edit <Text style={styles.highlight}>App.js</Text> to change
  42. this screen and then come back to see your edits.
  43. </Text>
  44. </View>
  45. <View style={styles.sectionContainer}>
  46. <Text style={styles.sectionTitle}>See Your Changes</Text>
  47. <Text style={styles.sectionDescription}>
  48. <ReloadInstructions />
  49. </Text>
  50. </View>
  51. <View style={styles.sectionContainer}>
  52. <Text style={styles.sectionTitle}>Debug</Text>
  53. <Text style={styles.sectionDescription}>
  54. <DebugInstructions />
  55. </Text>
  56. </View>
  57. <View style={styles.sectionContainer}>
  58. <Text style={styles.sectionTitle}>Learn More</Text>
  59. <Text style={styles.sectionDescription}>
  60. Read the docs to discover what to do next:
  61. </Text>
  62. </View>
  63. <LearnMoreLinks />
  64. </View>
  65. </ScrollView>
  66. )}
  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;