gab-social/app/javascript/gabsocial/components/badge.js

35 lines
699 B
JavaScript
Raw Normal View History

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-02-19 23:57:07 +00:00
const { hovering } = this.state
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
)
}
}