Last active
September 15, 2016 09:04
-
-
Save markbrown4/442e75ee3074d410ab54 to your computer and use it in GitHub Desktop.
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
if (this.props.store.submissionInProgress) { | |
className = styles.inProgress | |
} else if (this.props.store.errorOccurred) { | |
className = styles.error | |
} else if (!this.props.form.valid) { | |
className = styles.disabled | |
} else { | |
className = styles.normal | |
} | |
// simpler with strings additive | |
classes = classNames('normal', { | |
'in-progress': @props.store.submissionInProgress, | |
'error': @props.store.errorOccurred, | |
'disabled': !@props.form.valid | |
}) | |
// Suppose you could make a wrapper for it though pretty simply, non additive | |
classes = moduleName(styles, 'normal', { | |
'inProgress': @props.store.submissionInProgress, | |
'error': @props.store.errorOccurred, | |
'disabled': !@props.form.valid | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment