Remove empty space in title section on admin pages (#1490)

This commit is contained in:
Florian Scholdei
2021-01-06 09:17:40 +01:00
committed by GitHub
parent 5f0825b031
commit 8eb599ff94

View File

@@ -94,7 +94,7 @@ export default class Page extends React.Component<Props> {
} }
renderPageHeader() { renderPageHeader() {
const { error, afterTitle, subtitle, children } = this.props; const { error, afterTitle, title, subtitle, children } = this.props;
let pageActions = null; let pageActions = null;
let pageActionsExists = false; let pageActionsExists = false;
@@ -114,21 +114,24 @@ export default class Page extends React.Component<Props> {
}); });
const underline = pageActionsExists ? <hr className="header-with-actions" /> : null; const underline = pageActionsExists ? <hr className="header-with-actions" /> : null;
return ( if (title || subtitle) {
<> return (
<div className="columns"> <>
<div className="column"> <div className="columns">
<FlexContainer> <div className="column">
<Title title={this.getTextualTitle()}>{this.getTitleComponent()}</Title> <FlexContainer>
{afterTitle && <MarginLeft>{afterTitle}</MarginLeft>} <Title title={this.getTextualTitle()}>{this.getTitleComponent()}</Title>
</FlexContainer> {afterTitle && <MarginLeft>{afterTitle}</MarginLeft>}
<Subtitle subtitle={subtitle} /> </FlexContainer>
<Subtitle subtitle={subtitle} />
</div>
{pageActions}
</div> </div>
{pageActions} {underline}
</div> </>
{underline} );
</> }
); return null;
} }
renderContent() { renderContent() {