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

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-02-28 15:20:47 +00:00
import classNames from 'classnames/bind'
import Icon from './icon'
const cx = classNames.bind(_s)
export default class StatusActionBarItem extends PureComponent {
static propTypes = {
title: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired,
icon: PropTypes.string.isRequired,
active: PropTypes.bool,
disabled: PropTypes.bool,
}
render() {
const { title, onClick, icon, active, disabled } = this.props
const btnClasses = cx({
default: 1,
text: 1,
fontSize13PX: 1,
fontWeightMedium: 1,
cursorPointer: 1,
displayFlex: 1,
justifyContentCenter: 1,
flexRow: 1,
alignItemsCenter: 1,
2020-03-11 23:56:18 +00:00
py10: 1,
px10: 1,
2020-02-28 15:20:47 +00:00
width100PC: 1,
radiusSmall: 1,
2020-03-07 04:53:28 +00:00
outlineNone: 1,
2020-02-28 15:20:47 +00:00
backgroundTransparent: 1,
backgroundSubtle_onHover: 1,
colorSecondary: 1,
})
return (
2020-03-11 23:56:18 +00:00
<div className={[_s.default, _s.flexGrow1, _s.px10].join(' ')}>
2020-02-28 15:20:47 +00:00
<button
className={btnClasses}
onClick={onClick}
active={active}
disabled={disabled}
>
2020-03-11 23:56:18 +00:00
<Icon width='16px' height='16px' id={icon} className={[_s.default, _s.mr10, _s.fillColorSecondary].join(' ')} />
2020-02-28 15:20:47 +00:00
{title}
</button>
</div>
)
}
}