Skip to content

Instantly share code, notes, and snippets.

@dangreenisrael
Last active June 19, 2018 13:05
Show Gist options
  • Save dangreenisrael/188efd42cea535b25ac8d0ed7466ff7a to your computer and use it in GitHub Desktop.
Save dangreenisrael/188efd42cea535b25ac8d0ed7466ff7a to your computer and use it in GitHub Desktop.
Zi refactor
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