fixed a small bug that pageactions border without content were displayed on mobile page but was not allowed to

This commit is contained in:
Florian Scholdei
2019-02-21 17:21:04 +01:00
parent bcadd559f2
commit acef7e6e71

View File

@@ -44,11 +44,22 @@ class Page extends React.Component<Props> {
renderPageHeader() { renderPageHeader() {
const { title, subtitle, children, classes } = this.props; const { title, subtitle, children, classes } = this.props;
let content = null; let pageActions = null;
let pageActionsExists = false; let pageActionsExists = false;
React.Children.forEach(children, child => { React.Children.forEach(children, child => {
if (child && child.type.name === PageActions.name) { if (child && child.type.name === PageActions.name) {
content = child; pageActions = (
<div className="column is-two-fifths">
<div
className={classNames(
classes.spacing,
"is-mobile-create-button-spacing"
)}
>
{child}
</div>
</div>
);
pageActionsExists = true; pageActionsExists = true;
} }
}); });
@@ -63,9 +74,7 @@ class Page extends React.Component<Props> {
<Title title={title} /> <Title title={title} />
<Subtitle subtitle={subtitle} /> <Subtitle subtitle={subtitle} />
</div> </div>
<div className="column is-two-fifths"> {pageActions}
<div className={classNames(classes.spacing, "is-mobile-create-button-spacing")}>{content}</div>
</div>
</div> </div>
{underline} {underline}
</> </>