Skip to content

Commit 0d1891c

Browse files
committed
fix(nav): Rename ContentHeader to PageHeader
1 parent 6dcd13f commit 0d1891c

23 files changed

+137
-137
lines changed

cypress/component/ContentHeader.cy.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
import PageHeader from '@patternfly/react-component-groups/dist/dynamic/PageHeader';
3+
4+
describe('PageHeader', () => {
5+
it('should render PageHeader title and subtitle', () => {
6+
cy.mount(<PageHeader title='My title' subtitle='This is a subtitle for your page header' />);
7+
cy.get('title').should('exist')
8+
cy.get('[data-ouia-component-id="PageHeader-title"]').should('have.text', 'My title')
9+
cy.get('[data-ouia-component-id="PageHeader-subtitle"]').should('have.text', 'This is a subtitle for your page header')
10+
})
11+
});

cypress/component/ServiceCard.cy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('ServiceCard', () => {
99
title='Example'
1010
subtitle='A basic example'
1111
description='This is a basic ServiceCard Example'
12-
icon={<img src="/" alt="content-header-icon" />}
12+
icon={<img src="/" alt="page-header-icon" />}
1313
helperText='Here is helper text'
1414
ouiaId='Example'
1515
/>)
@@ -21,7 +21,7 @@ describe('ServiceCard', () => {
2121
title='Example'
2222
subtitle='A basic example'
2323
description='This is a basic ServiceCard Example'
24-
icon={<img src="/" alt="content-header-icon" />}
24+
icon={<img src="/" alt="page-header-icon" />}
2525
helperText='Here is helper text'
2626
ouiaId='Example'
2727
footer={<>

packages/module/patternfly-docs/content/extensions/component-groups/examples/ContentHeader/ContentHeader.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

packages/module/patternfly-docs/content/extensions/component-groups/examples/ContentHeader/ContentHeaderExample.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/module/patternfly-docs/content/extensions/component-groups/examples/ContentHeader/ContentHeaderIconExample.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
section: Component groups
3+
subsection: Content containers
4+
id: Page header
5+
source: react
6+
propComponents: ['PageHeader']
7+
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/PageHeader/PageHeader.md
8+
---
9+
10+
import PageHeader from "@patternfly/react-component-groups/dist/dynamic/PageHeader"
11+
import { EllipsisVIcon } from '@patternfly/react-icons';
12+
import pageHeaderIcon from '../../assets/icons/page-header-icon.svg'
13+
14+
The **page header** component displays a page header section with a title, subtitle and other optional content.
15+
16+
## Examples
17+
18+
### Basic page header
19+
20+
In order to display a basic page header, pass the `title` and `subtitle`.
21+
22+
```js file="./PageHeaderExample.tsx"
23+
24+
```
25+
26+
### Page header with breadcrumbs
27+
28+
You can display breadcrumbs above the title using the `breadcrumbs` property.
29+
30+
```js file="./PageHeaderBreadcrumbExample.tsx"
31+
32+
```
33+
34+
### Page header with icon
35+
36+
Use the `icon` property to display your custom page icon separated with a [divider](/components/divider).
37+
38+
```js file="./PageHeaderIconExample.tsx"
39+
40+
```
41+
42+
### Page header with label and link
43+
44+
To add specific element captions for user clarity and convenience, you can use the `label` property together with [label](/components/label) or your custom component. The `linkProps` can be used to define a link displayed under the subtitle.
45+
46+
```js file="./PageHeaderLabelLinkExample.tsx"
47+
48+
```
49+
50+
### Page header with actions menu
51+
52+
In case you want to display actions in your header, you can use the `actionsMenu` property.
53+
54+
```js file="./PageHeaderActionsExample.tsx"
55+
56+
```
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import ContentHeader from '@patternfly/react-component-groups/dist/dynamic/ContentHeader';
2+
import PageHeader from '@patternfly/react-component-groups/dist/dynamic/PageHeader';
33
import { ActionList, ActionListItem, Dropdown, DropdownItem, DropdownList, MenuToggle, MenuToggleElement } from '@patternfly/react-core';
44
import { EllipsisVIcon } from '@patternfly/react-icons';
55

@@ -29,9 +29,9 @@ export const ActionsExample: React.FunctionComponent = () => {
2929

3030
return (
3131
<React.Fragment>
32-
<ContentHeader
32+
<PageHeader
3333
title='My Title'
34-
subtitle='This is a subtitle for your content header'
34+
subtitle='This is a subtitle for your page header'
3535
actionMenu={
3636
<ActionList>
3737
<ActionListItem>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
2-
import ContentHeader from '@patternfly/react-component-groups/dist/dynamic/ContentHeader';
2+
import PageHeader from '@patternfly/react-component-groups/dist/dynamic/PageHeader';
33
import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core';
44

5-
export const BreadCrumbExample: React.FunctionComponent = () => (
6-
<ContentHeader
5+
export const BreadcrumbExample: React.FunctionComponent = () => (
6+
<PageHeader
77
breadcrumbs={
88
<Breadcrumb>
99
<BreadcrumbItem
@@ -29,6 +29,6 @@ export const BreadCrumbExample: React.FunctionComponent = () => (
2929
</Breadcrumb>
3030
}
3131
title='My Title'
32-
subtitle='This is a subtitle for your content header'
32+
subtitle='This is a subtitle for your page header'
3333
/>
3434
);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import PageHeader from '@patternfly/react-component-groups/dist/dynamic/PageHeader';
3+
4+
export const BasicExample: React.FunctionComponent = () => (
5+
<PageHeader
6+
title='My Title'
7+
subtitle='This is a subtitle for your page header'
8+
/>
9+
);

0 commit comments

Comments
 (0)