Skip to content

Commit 9d4b522

Browse files
committed
Remove masthead wrapping to reflect Core
1 parent 6fbef22 commit 9d4b522

4 files changed

Lines changed: 3 additions & 20 deletions

File tree

packages/react-core/src/components/Page/Page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
2929
*/
3030
isDockTextExpanded?: boolean;
3131
/** The horizontal masthead content (e.g. <Masthead /> or <PageHeader />). PageHeader is an alternative to Masthead
32-
* and can wrap a Masthead or custom header content. When using the docked variant, this content will only render at
32+
* and should only be used to wrap custom header content. When using the docked variant, this content will only render at
3333
* mobile viewports.
3434
*/
3535
masthead?: React.ReactNode;

packages/react-core/src/components/Page/PageHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styles from '@patternfly/react-styles/css/components/Page/page';
22
import { css } from '@patternfly/react-styles';
33

44
export interface PageHeaderProps extends React.HTMLProps<HTMLElement> {
5-
/** Content rendered inside the page header. This can be a Masthead or custom header content. */
5+
/** Content rendered inside the page header. This should be custom header content, rather than the PatternFly Masthead. */
66
children?: React.ReactNode;
77
/** Additional classes added to the page header */
88
className?: string;

packages/react-core/src/components/Page/__tests__/Page.test.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -500,21 +500,4 @@ describe('Page docked variant', () => {
500500
expect(header).toHaveClass(styles.pageHeader);
501501
expect(header.parentElement).toHaveClass(styles.page);
502502
});
503-
504-
test('Renders Masthead inside PageHeader when passed to the masthead prop', () => {
505-
render(
506-
<Page
507-
{...props}
508-
masthead={
509-
<PageHeader>
510-
<Masthead>Logo</Masthead>
511-
</PageHeader>
512-
}
513-
>
514-
<PageSection>Custom content</PageSection>
515-
</Page>
516-
);
517-
518-
expect(screen.getByText('Logo').closest(`.${styles.pageHeader}`)).toBeInTheDocument();
519-
});
520503
});

packages/react-core/src/components/Page/examples/Page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The `<MastheadMain>` component includes the smaller area that typically contains
3535

3636
### Page header
3737

38-
To use a page header instead of passing a [masthead](/components/masthead) directly, pass a `<PageHeader>` to the `masthead` property. `<PageHeader>` can wrap a `<Masthead>` or custom header content.
38+
To use a page header instead of passing a [masthead](/components/masthead) directly, pass a `<PageHeader>` to the `masthead` property. `<PageHeader>` should only be used to wrap custom header content.
3939

4040
```ts file="./PageHeaderContent.tsx"
4141

0 commit comments

Comments
 (0)