This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/assets/javascripts/components/features/ui/components/column_header.jsx
2017-02-09 01:20:09 +01:00

35 lines
676 B
JavaScript

import PureRenderMixin from 'react-addons-pure-render-mixin';
const ColumnHeader = React.createClass({
propTypes: {
icon: React.PropTypes.string,
type: React.PropTypes.string,
onClick: React.PropTypes.func
},
mixins: [PureRenderMixin],
handleClick () {
this.props.onClick();
},
render () {
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' onClick={this.handleClick}>
{icon}
{this.props.type}
</div>
);
}
});
export default ColumnHeader;