Skip to content

Instantly share code, notes, and snippets.

@KarineValenca
Last active February 8, 2019 18:52
Show Gist options
  • Save KarineValenca/697b5325b0a397e4057bdd7102f4c857 to your computer and use it in GitHub Desktop.
Save KarineValenca/697b5325b0a397e4057bdd7102f4c857 to your computer and use it in GitHub Desktop.
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import React, {Component} from 'react';
import {Alert, Platform, StyleSheet, Text, View, Button} from 'react-native';
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
android:
'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome} accessible={true} accessibilityLabel="welcome-message">Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
<Button onPress={() => {
Alert.alert('Você apertou o botão');
}} title="Pressione" color="#000000" accessibilityLabel="press-button"/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment