2016-08-31 07:15:12 -07:00
|
|
|
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
|
|
|
|
2016-08-24 08:56:44 -07:00
|
|
|
const ColumnHeader = React.createClass({
|
2016-08-31 07:15:12 -07:00
|
|
|
|
2016-08-24 08:56:44 -07:00
|
|
|
propTypes: {
|
2016-09-05 15:44:28 -07:00
|
|
|
icon: React.PropTypes.string,
|
|
|
|
type: React.PropTypes.string,
|
|
|
|
onClick: React.PropTypes.func
|
2016-08-24 08:56:44 -07:00
|
|
|
},
|
|
|
|
|
2016-08-31 07:15:12 -07:00
|
|
|
mixins: [PureRenderMixin],
|
|
|
|
|
2016-09-05 15:44:28 -07:00
|
|
|
handleClick () {
|
|
|
|
this.props.onClick();
|
|
|
|
},
|
|
|
|
|
2016-08-31 07:15:12 -07:00
|
|
|
render () {
|
2016-09-05 15:44:28 -07:00
|
|
|
let icon = '';
|
|
|
|
|
|
|
|
if (this.props.icon) {
|
|
|
|
icon = <i className={`fa fa-fw fa-${this.props.icon}`} style={{ display: 'inline-block', marginRight: '5px' }} />;
|
|
|
|
}
|
|
|
|
|
2016-08-24 08:56:44 -07:00
|
|
|
return (
|
2017-02-08 16:20:09 -08:00
|
|
|
<div className='column-header' onClick={this.handleClick}>
|
2016-09-05 15:44:28 -07:00
|
|
|
{icon}
|
2016-08-24 08:56:44 -07:00
|
|
|
{this.props.type}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-08-31 07:15:12 -07:00
|
|
|
|
2016-08-24 08:56:44 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
export default ColumnHeader;
|