You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
756 B

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. const ColumnHeader = React.createClass({
  3. propTypes: {
  4. icon: React.PropTypes.string,
  5. type: React.PropTypes.string,
  6. onClick: React.PropTypes.func
  7. },
  8. mixins: [PureRenderMixin],
  9. handleClick () {
  10. this.props.onClick();
  11. },
  12. render () {
  13. let icon = '';
  14. if (this.props.icon) {
  15. icon = <i className={`fa fa-fw fa-${this.props.icon}`} style={{ display: 'inline-block', marginRight: '5px' }} />;
  16. }
  17. return (
  18. <div onClick={this.handleClick} style={{ padding: '15px', fontSize: '16px', background: '#2f3441', flex: '0 0 auto', cursor: 'pointer' }}>
  19. {icon}
  20. {this.props.type}
  21. </div>
  22. );
  23. }
  24. });
  25. export default ColumnHeader;