|
|
@ -15,6 +15,7 @@ export default class PageContainerHeader extends Component { |
|
|
|
tabs: PropTypes.node, |
|
|
|
tabs: PropTypes.node, |
|
|
|
headerCloseText: PropTypes.string, |
|
|
|
headerCloseText: PropTypes.string, |
|
|
|
className: PropTypes.string, |
|
|
|
className: PropTypes.string, |
|
|
|
|
|
|
|
hideClose: PropTypes.bool, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
renderTabs() { |
|
|
|
renderTabs() { |
|
|
@ -23,6 +24,37 @@ export default class PageContainerHeader extends Component { |
|
|
|
return tabs && <ul className="page-container__tabs">{tabs}</ul>; |
|
|
|
return tabs && <ul className="page-container__tabs">{tabs}</ul>; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderCloseAction() { |
|
|
|
|
|
|
|
const { hideClose, onClose, headerCloseText } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hideClose) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (headerCloseText) { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
onClose && ( |
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
|
|
type="link" |
|
|
|
|
|
|
|
className="page-container__header-close-text" |
|
|
|
|
|
|
|
onClick={() => onClose()} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{headerCloseText} |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
onClose && ( |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
className="page-container__header-close" |
|
|
|
|
|
|
|
onClick={() => onClose()} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
renderHeaderRow() { |
|
|
|
renderHeaderRow() { |
|
|
|
const { |
|
|
|
const { |
|
|
|
showBackButton, |
|
|
|
showBackButton, |
|
|
@ -47,14 +79,7 @@ export default class PageContainerHeader extends Component { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { |
|
|
|
const { title, subtitle, tabs, className, hideClose } = this.props; |
|
|
|
title, |
|
|
|
|
|
|
|
subtitle, |
|
|
|
|
|
|
|
onClose, |
|
|
|
|
|
|
|
tabs, |
|
|
|
|
|
|
|
headerCloseText, |
|
|
|
|
|
|
|
className, |
|
|
|
|
|
|
|
} = this.props; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
@ -65,26 +90,18 @@ export default class PageContainerHeader extends Component { |
|
|
|
> |
|
|
|
> |
|
|
|
{this.renderHeaderRow()} |
|
|
|
{this.renderHeaderRow()} |
|
|
|
|
|
|
|
|
|
|
|
{title && <div className="page-container__title">{title}</div>} |
|
|
|
{title && ( |
|
|
|
|
|
|
|
<div |
|
|
|
{subtitle && <div className="page-container__subtitle">{subtitle}</div>} |
|
|
|
className={classnames('page-container__title', { |
|
|
|
|
|
|
|
'page-container__title--no-margin-right': hideClose, |
|
|
|
{onClose && headerCloseText ? ( |
|
|
|
})} |
|
|
|
<Button |
|
|
|
|
|
|
|
type="link" |
|
|
|
|
|
|
|
className="page-container__header-close-text" |
|
|
|
|
|
|
|
onClick={() => onClose()} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
{headerCloseText} |
|
|
|
{title} |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
|
|
|
|
onClose && ( |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
className="page-container__header-close" |
|
|
|
|
|
|
|
onClick={() => onClose()} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
{subtitle && <div className="page-container__subtitle">{subtitle}</div>} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.renderCloseAction()} |
|
|
|
|
|
|
|
|
|
|
|
{this.renderTabs()} |
|
|
|
{this.renderTabs()} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|