bastodon/app/assets/javascripts/components/features/ui/components/column_header.jsx
Ash Furrow 78af88e1f4 Hides superluous details on small screens (#2175)
* Hides superluous details on small screans.

* Addressed feedback from #2175.
2017-04-21 18:17:55 +02:00

38 lines
910 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,
hideOnMobile: React.PropTypes.bool
},
mixins: [PureRenderMixin],
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>
);
}
});
export default ColumnHeader;