Skip to content

Instantly share code, notes, and snippets.

@puiutucutu
Created July 27, 2017 15:38
Show Gist options
  • Save puiutucutu/079ea78b7803d220b7d0e4cd8773ff9d to your computer and use it in GitHub Desktop.
Save puiutucutu/079ea78b7803d220b7d0e4cd8773ff9d to your computer and use it in GitHub Desktop.
Blueprint with classNames and Blueprint Classes
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