Re-organizing components to be more modular, adding loading bars
This commit is contained in:
parent
f820edb463
commit
337462aa5e
31 changed files with 155 additions and 126 deletions
|
|
@ -0,0 +1,34 @@
|
|||
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 onClick={this.handleClick} style={{ padding: '15px', fontSize: '16px', background: '#2f3441', flex: '0 0 auto', cursor: 'pointer' }}>
|
||||
{icon}
|
||||
{this.props.type}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
export default ColumnHeader;
|
||||
Reference in a new issue