React native progress steps authentication before moving to next step

1k views Asked by At

So I'm using this custom component progress steps from this github library: https://github.com/colbymillerdev/react-native-progress-steps/tree/master and my code looks like this:

   <View style={styles.container}>

        <ProgressSteps  >
            <ProgressStep label="authentication " nextBtnDisabled={true} >

                    <Authentication />
               </ProgressStep>
        <ProgressStep label="Confirmation">
            <View style={{ alignItems: 'center' }}>
                <Text>good job !</Text>
            </View>
        </ProgressStep>
    </ProgressSteps>
    </View>

so there is only two screen, the first where you enter your user name and password,in this step i called a fetch api, so if the infos are correct it should lead you to the next step of confirmation. and that's what i'm trying to do. the code of (Authentication/) is:

.....
 <Button style={styles} color='#FFC617' title='log in' onPress={this.Autho} />
........
Autho = () => {
       console.log(this.state) 
       fetch(....) 
      .then((response) => response.json())
      .then((res) => {
    if ("user_context" in res) {
      AsyncStorage.setItem('user',res.user);
      *what should i write here*

    }
    else {
      alert("Error");

    }
  })
  .done();
  }

this is the method rendered every time you click the connect button log in i already tested it and it works fine but i want it to lead me to the next step. as you can see i had nextBtnDisabled={true} so you can't go to the next step without login in. i hope i detailed enough for you to understand and i really appreciate your response.thank you!

0

There are 0 answers