2020-02-19 23:57:07 +00:00
|
|
|
import Text from './text'
|
|
|
|
|
|
|
|
export default class Badge extends PureComponent {
|
|
|
|
static propTypes = {
|
|
|
|
children: PropTypes.string,
|
2020-02-21 00:57:29 +00:00
|
|
|
description: PropTypes.string,
|
2020-02-19 23:57:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
state = {
|
|
|
|
hovering: false,
|
|
|
|
}
|
|
|
|
|
|
|
|
handleOnMouseEnter = () => {
|
|
|
|
this.setState({ hovering: true })
|
|
|
|
}
|
|
|
|
|
|
|
|
handleOnMouseLeave = () => {
|
|
|
|
this.setState({ hovering: false })
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-02-21 00:57:29 +00:00
|
|
|
const { children, description } = this.props
|
2020-03-04 03:45:16 +00:00
|
|
|
const { hovering } = this.state // : todo : tooltip
|
2020-02-19 23:57:07 +00:00
|
|
|
|
|
|
|
return (
|
2020-02-21 00:57:29 +00:00
|
|
|
<Text
|
|
|
|
color='white'
|
|
|
|
size='extraSmall'
|
|
|
|
className={[_s.backgroundColorBrand, _s.paddingHorizontal5PX, _s.lineHeight125, _s.radiusSmall].join(' ')}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Text>
|
2020-02-19 23:57:07 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|