Created
November 8, 2018 11:34
-
-
Save cbrannen9a/0b70a34e937ea1b95b51e7194b942ebd to your computer and use it in GitHub Desktop.
Portion of main Checkout.js with state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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