Skip to content

Instantly share code, notes, and snippets.

@cbrannen9a
Created November 8, 2018 11:34
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cbrannen9a/0b70a34e937ea1b95b51e7194b942ebd to your computer and use it in GitHub Desktop.
Portion of main Checkout.js with state
class Checkout extends Component {
state = {
activeStep: 0,
addressForm: {
firstName: '',
lastName: '',
address1: '',
address2: '',
city: '',
state: '',
zip: '',
country: '',
},
paymentForm: {
cardName: '',
cardNumber: '',
expDate: '',
cvv: '',
},
products: [
{ name: 'Product 1', desc: 'A nice thing', price: '$9.99' },
{ name: 'Product 2', desc: 'Another thing', price: '$3.47' },
{ name: 'Product 3', desc: 'Something else', price: '$6.51' },
{ name: 'Product 4', desc: 'Best thing of all', price: '$14.11' },
],
validation: {
hasErrorAddressForm: true,
hasErrorPaymentForm: true,
errorTypes: {}
}
};
//....
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment