parent
a51aa91caf
commit
270d5e9b72
1 changed files with 11 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
export default class ColumnHeader extends React.PureComponent {
|
export default class ColumnHeader extends React.PureComponent {
|
||||||
|
|
||||||
|
@ -16,19 +17,20 @@ export default class ColumnHeader extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { type, active, columnHeaderId } = this.props;
|
const { icon, type, active, columnHeaderId } = this.props;
|
||||||
|
let iconElement = '';
|
||||||
|
|
||||||
let icon = '';
|
if (icon) {
|
||||||
|
iconElement = <i className={`fa fa-fw fa-${icon} column-header__icon`} />;
|
||||||
if (this.props.icon) {
|
|
||||||
icon = <i className={`fa fa-fw fa-${this.props.icon} column-header__icon`} />;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div role='heading' tabIndex='0' className={`column-header ${active ? 'active' : ''}`} onClick={this.handleClick} id={columnHeaderId || null}>
|
<h1 className={classNames('column-header', { active })} id={columnHeaderId || null}>
|
||||||
{icon}
|
<button onClick={this.handleClick}>
|
||||||
{type}
|
{iconElement}
|
||||||
</div>
|
{type}
|
||||||
|
</button>
|
||||||
|
</h1>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue