Created
July 27, 2017 15:38
-
-
Save puiutucutu/079ea78b7803d220b7d0e4cd8773ff9d to your computer and use it in GitHub Desktop.
Blueprint with classNames and Blueprint Classes
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
import classNames from 'classnames' | |
import { Classes, Intent } from '@blueprintjs/core' | |
render() { | |
let classes | |
// method one | |
classes = classNames('pt-tag','pt-large', { | |
[Classes.INTENT_DANGER]: daysElapsed > 7, | |
}) | |
// method 2 | |
classes = classNames('pt-tag', 'pt-large', daysElapsed > 7 && Classes.intentClass(3)) | |
classes = classNames('pt-tag', 'pt-large', daysElapsed > 7 ? Classes.intentClass(3) : Classes.intentClass(1)) | |
return <span className={classes}>{daysElapsed}</span> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment