Add icons to column headers, click them to scroll to top
This commit is contained in:
parent
1f18cf97b5
commit
ac77170d19
4 changed files with 26 additions and 7 deletions
|
|
@ -3,14 +3,27 @@ import PureRenderMixin from 'react-addons-pure-render-mixin';
|
|||
const ColumnHeader = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
type: React.PropTypes.string
|
||||
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 style={{ padding: '15px', fontSize: '16px', background: '#2f3441', flex: '0 0 auto' }}>
|
||||
<div onClick={this.handleClick} style={{ padding: '15px', fontSize: '16px', background: '#2f3441', flex: '0 0 auto', cursor: 'pointer' }}>
|
||||
{icon}
|
||||
{this.props.type}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Reference in a new issue