diff options
author | Husam Salhab <47015061+hsalhab@users.noreply.github.com> | 2020-06-24 20:01:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 20:01:35 -0400 |
commit | c301252081ef31fe24160713d801722fc73e703b (patch) | |
tree | 86f4d47d56a3945ab8f763e132b81aaaa5b2e2f8 /App.tsx | |
parent | 4efe926122873adf8a598bb18b3eaf5d5a077cb4 (diff) | |
parent | d9e0cde89b1e2c2483f91c656d6000f3b806181d (diff) |
Merge pull request #3 from leonyjiang/master
[TMA-55] - Add react-native/typescript template
Diffstat (limited to 'App.tsx')
-rw-r--r-- | App.tsx | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/App.tsx b/App.tsx new file mode 100644 index 00000000..6106df43 --- /dev/null +++ b/App.tsx @@ -0,0 +1,118 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * Generated with the TypeScript template + * https://github.com/react-native-community/react-native-template-typescript + * + * @format + */ + +import React from 'react'; +import { + SafeAreaView, + StyleSheet, + ScrollView, + View, + Text, + StatusBar, +} from 'react-native'; + +import { + Header, + LearnMoreLinks, + Colors, + DebugInstructions, + ReloadInstructions, +} from 'react-native/Libraries/NewAppScreen'; + +declare const global: {HermesInternal: null | {}}; + +const App = () => { + return ( + <> + <StatusBar barStyle="dark-content" /> + <SafeAreaView> + <ScrollView + contentInsetAdjustmentBehavior="automatic" + style={styles.scrollView}> + <Header /> + {global.HermesInternal == null ? null : ( + <View style={styles.engine}> + <Text style={styles.footer}>Engine: Hermes</Text> + </View> + )} + <View style={styles.body}> + <View style={styles.sectionContainer}> + <Text style={styles.sectionTitle}>Step One</Text> + <Text style={styles.sectionDescription}> + Edit <Text style={styles.highlight}>App.tsx</Text> in order to change + this screen and then come back to see your edits. + </Text> + </View> + <View style={styles.sectionContainer}> + <Text style={styles.sectionTitle}>See Your Changes</Text> + <Text style={styles.sectionDescription}> + <ReloadInstructions /> + </Text> + </View> + <View style={styles.sectionContainer}> + <Text style={styles.sectionTitle}>Debug</Text> + <Text style={styles.sectionDescription}> + <DebugInstructions /> + </Text> + </View> + <View style={styles.sectionContainer}> + <Text style={styles.sectionTitle}>Learn More</Text> + <Text style={styles.sectionDescription}> + Read the docs to discover what to do next: + </Text> + </View> + <LearnMoreLinks /> + </View> + </ScrollView> + </SafeAreaView> + </> + ); +}; + +const styles = StyleSheet.create({ + scrollView: { + backgroundColor: Colors.lighter, + }, + engine: { + position: 'absolute', + right: 0, + }, + body: { + backgroundColor: Colors.white, + }, + sectionContainer: { + marginTop: 32, + paddingHorizontal: 24, + }, + sectionTitle: { + fontSize: 24, + fontWeight: '600', + color: Colors.black, + }, + sectionDescription: { + marginTop: 8, + fontSize: 18, + fontWeight: '400', + color: Colors.dark, + }, + highlight: { + fontWeight: '700', + }, + footer: { + color: Colors.dark, + fontSize: 12, + fontWeight: '600', + padding: 4, + paddingRight: 12, + textAlign: 'right', + }, +}); + +export default App; |