Created
November 8, 2018 11:34
Star
You must be signed in to star a gist
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