Я разрабатываю страницу входа в систему на собственном языке, используя PHP в качестве BackEnd (где я получаю свои sql данные),
Моя проблема заключается в том, что я пишу свое имя пользователя и пароль и нажимаю кнопку Кнопка подключения. Мне нужно показать пользователям, что я работаю над его подключением.
Я хочу показать диалоговое окно, пока выполняются запросы
export default class Home extends React.Component {
constructor(props){
super(props);}
userRegister = () =>{
const usermail = this.state.usermail;
const password = this.state.password;
fetch('http://192.168.1.2:80/netOne/recup.php',{
method:'post',
header:{'Accept':'application/json','Content-type' :'application/json'},
body:JSON.stringify({email:usermail,password:password,})})
.then((responseData)=>responseData.text())
.then((responseJson)=>{
if(responseJson =='Data Matched'){
this.props.navigation.navigate( 'Welcome')}
else{alert(JSON.stringify("Merci de saisir des données convenables"));}})
.catch((error)=>{console.error(error);})
render() {
return (
<View style={styles.container}>
<Image
style={{width: 150, height: 150}}
source={require('./netOne.jpg')}
/>
<View style={styles.pass}>
<Text style={{marginTop:20 , color:'grey'}}>Username :</Text>
<TextInput placeholder={this.state.placeholder1} style={{flex:1,paddingLeft:5}}
onChangeText= {usermail=>this.setState({usermail })}/>
</View>
<View style={styles.pass}>
<Text style={{marginTop:20 , color:'grey'}}>Password :</Text>
<TextInput placeholder={this.state.placeholder2} style={{flex:1,paddingLeft:5}} secureTextEntry={this.state.secureTextEntry}
onChangeText= {password=>this.setState({password})}
/>
<TouchableOpacity onPress={this.secure} style={{margin:20}}>
<Icon name="eye" size={20} /></TouchableOpacity>
</View>
<TouchableOpacity style={styles.butt} onPress={this.userRegister}>
<Text>Connexion</Text>
</TouchableOpacity>
</View>
);
}
}
Мне нужно что-то подобное! ! пожалуйста, если вы можете мне помочь 