Last active
November 28, 2019 08:33
-
-
Save arnaudambro/2deb948eec32148b6b6b6d0cf4dfcef0 to your computer and use it in GitHub Desktop.
App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
SafeAreaView, | |
StyleSheet, | |
View, | |
Text, | |
StatusBar, | |
TouchableOpacity, | |
} from 'react-native'; | |
class App extends React.Component { | |
render() { | |
return ( | |
<> | |
<StatusBar barStyle="dark-content" /> | |
<SafeAreaView style={styles.body}> | |
<TouchableOpacity | |
accessibilityRole={'button'} | |
onPress={() => console.log(Notification in 10 seconds)} | |
style={styles.linkContainer}> | |
<Text style={styles.link}>Notification in 10 seconds</Text> | |
</TouchableOpacity> | |
<View style={styles.separator} /> | |
<TouchableOpacity | |
accessibilityRole={'button'} | |
onPress={() => console.log(Notification now)} | |
style={styles.linkContainer}> | |
<Text style={styles.link}>Notification now</Text> | |
</TouchableOpacity> | |
</SafeAreaView> | |
</> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
body: { | |
backgroundColor: '#333', | |
justifyContent: 'space-around', | |
alignItems: 'center', | |
flex: 1, | |
height: '100%', | |
}, | |
container: { | |
marginTop: 32, | |
paddingHorizontal: 24, | |
}, | |
linkContainer: { | |
justifyContent: 'center', | |
alignItems: 'center', | |
paddingVertical: 8, | |
backgroundColor: '#ddd', | |
borderRadius: 40, | |
height: 40, | |
width: '80%', | |
}, | |
link: { | |
flex: 2, | |
fontSize: 18, | |
fontWeight: '400', | |
color: '#333', | |
justifyContent: 'center', | |
alignItems: 'center', | |
}, | |
separator: { | |
backgroundColor: '#ddd', | |
height: 1, | |
width: '100%', | |
}, | |
}); | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment