Last active
June 19, 2018 13:05
-
-
Save dangreenisrael/188efd42cea535b25ac8d0ed7466ff7a to your computer and use it in GitHub Desktop.
Zi refactor
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
const Resumitable = props => ( | |
<WaveButton | |
isDisabled={props.isResubmitting} | |
isLoading={props.isResubmitting} | |
type={WaveButtonTypes.SECONDARY} | |
onClick={props.onClick} > | |
{props.text} | |
</WaveButton> | |
) | |
const Modal = props => ( | |
<WaveButton type={WaveButtonTypes.SECONDARY} onClick={props.onClick}> | |
{props.text} | |
</WaveButton> | |
) | |
render(){ | |
if(isSupportRequired){ | |
return <ContactSupportButton transactionId={problem.id} buttonText={problem.actionText} /> | |
} | |
if(problem.modal){ | |
return <Modal text={problem.actionText} onClick={this.openModal} | |
} | |
if(problem.isResubmittable){ | |
return <Resumitable | |
isResubmitting={problem.isResubmitting} | |
onClick={problem.resubmitTransaction} | |
text={problem.actionText} /> | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment