Skip to content

Commit 8eaeda6

Browse files
committed
Ommit header markup if not content is passed
1 parent 40cc599 commit 8eaeda6

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/components/Page/Page.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,14 @@ html, body {
5757
.Header-hasPagination,
5858
.Header-hasBreadcrumbs {
5959
padding-top: spacing(loose);
60-
padding-bottom: rem(24px);
61-
62-
&.Header-hasSecondaryActions {
63-
padding-bottom: spacing(loose);
64-
}
6560
}
6661

6762
.Header-hasSecondaryActions {
6863
padding-top: rem(24px);
69-
padding-bottom: spacing(loose);
7064
}
7165

7266
.Header-hasSeparator {
67+
padding-bottom: spacing();
7368
border-bottom: border();
7469

7570
+ .Content {

src/components/Page/Page.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class Page extends React.PureComponent<Props, never> {
5353
fullWidth && styles.fullWidth,
5454
);
5555

56-
const headerMarkup = this.context.easdk
56+
const headerMarkup = this.context.easdk || !this.hasHeaderContent()
5757
? null
5858
: <Header {...rest} />;
5959

@@ -74,4 +74,14 @@ export default class Page extends React.PureComponent<Props, never> {
7474
easdk.Bar.update(this.props);
7575
}
7676
}
77+
78+
private hasHeaderContent() {
79+
const { title, primaryAction, secondaryActions, breadcrumbs } = this.props;
80+
return (
81+
(title && title !== '')
82+
|| primaryAction
83+
|| (secondaryActions && secondaryActions.length > 0)
84+
|| (breadcrumbs && breadcrumbs.length > 0)
85+
);
86+
}
7787
}

0 commit comments

Comments
 (0)