export default class Tela1 extends React.Component {
constructor ( props){
super ( props);
this.state = {
username : '',
passaword : ' ',
}
}
ComponentDidMount (){
this._loadInitialState().done();
}
_loadInitialState = async () => {
var value = await AsyncStorage.getItem ('user');
if(value !== null){
const Nome = this.username;
this.props.navigation.navigate('Tela2' , Nome);
}
}
Login screen
SCREEN 2
render() {
const params = this.props.navigation.state.params;
return (
<ImageBackground source={require('./foto/i1.jpg')} style = {{ width : '100%',height : '100%', flex : 1}} >
<View style={styles.container}>
<Header style = {{ backgroundColor : '#ffcc00'}}>
<Left>
<Button transparent>
</Button>
</Left>
<Body>
<Title style = {{ color : 'black'}}>Top Fit </Title>
</Body>
<Right>
</Right>
</Header>
<View style={{flex: 1, justifyContent: 'center',alignItems: 'center'}}>
<TouchableHighlight onPress={() => this.props.navigation.navigate('Tela3',
{
texto: "Weverton é um bobão", uri: "https://media.giphy.com/media/mMC2BVxQWd6Ql3oOyI/giphy.gif"
,texto2: "LALALALLALAA"
})}>
<View style={styles.button}>
<Text style={styles.buttonText}>Exercicios</Text>
</View>
</TouchableHighlight>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Exercicios')}>
<View style={styles.button}>
<Text style={styles.buttonText}>Treino</Text>
</View>
</TouchableOpacity>
<TouchableNativeFeedback
onPress={() => this.props.navigation.navigate('Meus_dados' ) }>
<View style={styles.button}>
<Text style={styles.buttonText} > {params} </Text>
</View>
</TouchableNativeFeedback>
</View>