* Remove deprecated features at React v15.5
- [x] React.PropTypes
- [x] react-addons-pure-render-mixin
- [x] react-addons-test-utils
* Uncommented out & Add browserify_rails options
* re-add react-addons-shallow
* Fix syntax error from resolve conflicts
* follow up 59a77923b3
41 lines
945 B
JavaScript
41 lines
945 B
JavaScript
import PropTypes from 'prop-types'
|
|
|
|
class ColumnHeader extends React.PureComponent {
|
|
|
|
constructor (props, context) {
|
|
super(props, context);
|
|
this.handleClick = this.handleClick.bind(this);
|
|
}
|
|
|
|
handleClick () {
|
|
this.props.onClick();
|
|
}
|
|
|
|
render () {
|
|
const { type, active, hideOnMobile } = 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 role='button' tabIndex='0' aria-label={type} className={`column-header ${active ? 'active' : ''} ${hideOnMobile ? 'hidden-on-mobile' : ''}`} onClick={this.handleClick}>
|
|
{icon}
|
|
{type}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
ColumnHeader.propTypes = {
|
|
icon: PropTypes.string,
|
|
type: PropTypes.string,
|
|
active: PropTypes.bool,
|
|
onClick: PropTypes.func,
|
|
hideOnMobile: PropTypes.bool
|
|
};
|
|
|
|
export default ColumnHeader;
|