Simplify column headers (#27557)
This commit is contained in:
parent
1f5187e2e2
commit
13d310e64d
13 changed files with 113 additions and 125 deletions
|
@ -3,15 +3,15 @@ import { PureComponent } from 'react';
|
|||
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import ColumnHeader from '../../../components/column_header';
|
||||
import { isMobile } from '../../../is_mobile';
|
||||
import { scrollTop } from '../../../scroll';
|
||||
|
||||
import ColumnHeader from './column_header';
|
||||
|
||||
export default class Column extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
heading: PropTypes.string,
|
||||
alwaysShowBackButton: PropTypes.bool,
|
||||
icon: PropTypes.string,
|
||||
iconComponent: PropTypes.func,
|
||||
children: PropTypes.node,
|
||||
|
@ -51,13 +51,14 @@ export default class Column extends PureComponent {
|
|||
};
|
||||
|
||||
render () {
|
||||
const { heading, icon, iconComponent, children, active, hideHeadingOnMobile } = this.props;
|
||||
const { heading, icon, iconComponent, children, active, hideHeadingOnMobile, alwaysShowBackButton } = this.props;
|
||||
|
||||
const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));
|
||||
|
||||
const columnHeaderId = showHeading && heading.replace(/ /g, '-');
|
||||
|
||||
const header = showHeading && (
|
||||
<ColumnHeader icon={icon} iconComponent={iconComponent} active={active} type={heading} onClick={this.handleHeaderClick} columnHeaderId={columnHeaderId} />
|
||||
<ColumnHeader icon={icon} iconComponent={iconComponent} active={active} title={heading} onClick={this.handleHeaderClick} columnHeaderId={columnHeaderId} showBackButton={alwaysShowBackButton} />
|
||||
);
|
||||
return (
|
||||
<div
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue