Created
November 9, 2018 18:25
-
-
Save abnersajr/941871c7bc3183d62ae53a9ece57b95b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
constructor() { | |
this.openModal = this.openModal.bind(this); | |
this.closeModal = this.closeModal.bind(this); | |
} | |
openModal(modal) { | |
this.setState({ | |
[modal]: true, | |
}); | |
} | |
closeModal(modal) { | |
this.setState({ | |
[modal]: false, | |
}); | |
} | |
<OrderReceiptModal | |
isOpen={isOrderReceiptModalOpen} | |
onCloseModal={() => this.closeModal('isOrderReceiptModalOpen')} | |
/> | |
<OrderReceiptDialog | |
isOpen={isReceiptDialogOpen} | |
onRequestClose={() => this.closeModal('isReceiptDialogOpen')} | |
/> | |
<PaymentMethodsModal | |
isOpen={isPaymentMethodsModalOpen} | |
onRequestClose={() => this.closeModal('isPaymentMethodsModalOpen')} | |
onPayWithCardClick={() => this.openModal('isCreditCardModalOpen')} | |
/> | |
<AddressListModal | |
isOpen={isAddressListModalOpen} | |
onRequestClose={() => this.closeModal('isAddressListModalOpen')} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment