mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
37 lines
769 B
JavaScript
37 lines
769 B
JavaScript
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
|
|
|
const ColumnHeader = React.createClass({
|
|
|
|
propTypes: {
|
|
icon: React.PropTypes.string,
|
|
type: React.PropTypes.string,
|
|
active: React.PropTypes.bool,
|
|
onClick: React.PropTypes.func
|
|
},
|
|
|
|
mixins: [PureRenderMixin],
|
|
|
|
handleClick () {
|
|
this.props.onClick();
|
|
},
|
|
|
|
render () {
|
|
const { type, active } = this.props;
|
|
|
|
let icon = '';
|
|
|
|
if (this.props.icon) {
|
|
icon = <i className={`fa fa-fw fa-${this.props.icon}`} style={{ display: 'inline-block', marginRight: '5px' }} />;
|
|
}
|
|
|
|
return (
|
|
<div className={`column-header ${active ? 'active' : ''}`} onClick={this.handleClick}>
|
|
{icon}
|
|
{type}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
});
|
|
|
|
export default ColumnHeader;
|