@felipecchaves
import React, { Component } from 'react'
import { Alert, Text, StyleSheet, View, Image, TextInput, TouchableOpacity } from 'react-native'
export default class App extends Component {
clicou = () => {
Alert.alert("Trabalho", "Login efetuado!");
}
state = {
nome: ''
}
render() {
return (
<View style={styles.container}>
<Image
source={require('./assets/logo.png')}
style={styles.logo}
/>
<TextInput
style={styles.input}
onChangeText={ text => this.state.nome = text }
placeholder="Digite seu email:"
/>
<TextInput
style={styles.input}
secureTextEntry={true}
placeholder="Digite sua senha:"
/>
<TouchableOpacity
style={styles.botao}
onPress={ () => { this.props.navigation.navigate('Home', {'nome': this.state.nome}) } }
>
<Text style={styles.botaoText}>Login</Text>
</TouchableOpacity>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex:1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#2c7a87'
},
logo: {
width: 150,
height: 150,
borderRadius: 100
},
input: {
marginTop: 10,
padding: 10,
width: 300,
backgroundColor: '#fff',
fontSize: 13,
fontWeight: 'bold',
borderRadius: 3
},
botao:{
width: 300,
height: 42,
backgroundColor: '#3121db',
marginTop: 10,
borderRadius: 4,
alignItems: 'center',
justifyContent: 'center',
},
botaoText:{
fontSize: 16,
fontWeight: 'bold',
color: '#fff'
}
})