Skip to content

Instantly share code, notes, and snippets.

@cbrannen9a
Created November 8, 2018 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cbrannen9a/d56c56dfe2f63df7fae6a1053f69b756 to your computer and use it in GitHub Desktop.
Save cbrannen9a/d56c56dfe2f63df7fae6a1053f69b756 to your computer and use it in GitHub Desktop.
Partial Checkout6
handleValid = () => {
const { activeStep, validation } = this.state;
if (activeStep === 0 && !validation.hasErrorAddressForm) {
return false;
} else if (activeStep === 2) {
return false;
}
return true;
}
//...
...//
//The Next/Place Order button
<Button
variant="contained"
color="primary"
onClick={this.handleNext}
className={classes.button}
disabled={this.handleValid()}
>
{activeStep === steps.length - 1 ? 'Place order' : 'Next'}
</Button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment