File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
22import {
3+ Button ,
4+ ButtonProps ,
5+ ButtonVariant ,
6+ Content ,
7+ Divider ,
38 Flex ,
49 FlexItem ,
10+ PageBreadcrumb ,
11+ PageSection ,
512 Split ,
613 SplitItem ,
7- Content ,
8- PageSection ,
9- Button ,
10- ButtonVariant ,
11- ButtonProps ,
12- Divider ,
1314} from '@patternfly/react-core' ;
1415import { ExternalLinkAltIcon } from '@patternfly/react-icons' ;
1516import { createUseStyles } from 'react-jss' ;
@@ -64,54 +65,61 @@ export const PageHeader: React.FunctionComponent<PageHeaderProps> = ({
6465 const { isExternal = false , ...linkRestProps } = linkProps ?? { } ;
6566
6667 return (
67- < PageSection hasBodyWrapper = { false } >
68- { breadcrumbs && (
69- < div className = "pf-v6-u-mb-md" >
68+ < >
69+ { breadcrumbs && (
70+ < PageBreadcrumb >
7071 { breadcrumbs }
71- </ div >
72+ </ PageBreadcrumb >
7273 ) }
73- < Flex >
74- { icon && (
75- < >
76- < FlexItem alignSelf = { { default : 'alignSelfCenter' } } className = { `${ classes . iconMinWidth } ` } >
77- { icon }
78- </ FlexItem >
79- < Divider orientation = { {
80- default : 'vertical' ,
81- } } />
82- </ >
83- ) }
84- < FlexItem flex = { { default : 'flex_1' } } >
85- < Split hasGutter >
86- < SplitItem >
87- < Content className = "pf-v6-u-mb-sm" component = "h1" ouiaId = { `${ ouiaId } -title` } >
88- { title }
74+ < PageSection hasBodyWrapper = { false } >
75+ < Flex >
76+ { icon && (
77+ < >
78+ < FlexItem alignSelf = { { default : 'alignSelfCenter' } } className = { classes . iconMinWidth } >
79+ { icon }
80+ </ FlexItem >
81+ < Divider orientation = { {
82+ default : 'vertical' ,
83+ } } />
84+ </ >
85+ ) }
86+ < FlexItem flex = { { default : 'flex_1' } } >
87+ < Split hasGutter >
88+ { title && (
89+ < SplitItem >
90+ < Content className = "pf-v6-u-mb-sm" component = "h1" ouiaId = { `${ ouiaId } -title` } >
91+ { title }
92+ </ Content >
93+ </ SplitItem >
94+ ) }
95+ { label && (
96+ < SplitItem >
97+ { label }
98+ </ SplitItem >
99+ ) }
100+ < SplitItem isFilled />
101+ { actionMenu && (
102+ < SplitItem >
103+ { actionMenu }
104+ </ SplitItem >
105+ ) }
106+ </ Split >
107+ { subtitle && (
108+ < Content component = "p" ouiaId = { `${ ouiaId } -subtitle` } >
109+ { subtitle }
89110 </ Content >
90- </ SplitItem >
91- { label && (
92- < SplitItem >
93- { label }
94- </ SplitItem >
95111 ) }
96- < SplitItem isFilled />
97- { actionMenu && (
98- < SplitItem >
99- { actionMenu }
100- </ SplitItem >
112+ { linkProps && (
113+ < Button variant = { ButtonVariant . link } component = "a" ouiaId = { `${ ouiaId } -link-button` } isInline icon = { isExternal ? < ExternalLinkAltIcon className = 'pf-v6-u-ml-sm' /> : null } iconPosition = "end" { ...linkRestProps } >
114+ { linkProps . label }
115+ </ Button >
101116 ) }
102- </ Split >
103- < Content component = "p" ouiaId = { `${ ouiaId } -subtitle` } >
104- { subtitle }
105- </ Content >
106- { linkProps && (
107- < Button variant = { ButtonVariant . link } component = "a" ouiaId = { `${ ouiaId } -link-button` } isInline icon = { isExternal ? < ExternalLinkAltIcon className = 'pf-v6-u-ml-sm' /> : null } iconPosition = "end" { ...linkRestProps } >
108- { linkProps . label }
109- </ Button >
110- ) }
111- </ FlexItem >
112- </ Flex >
113- { children }
114- </ PageSection >
115- ) } ;
117+ </ FlexItem >
118+ </ Flex >
119+ { children }
120+ </ PageSection >
121+ </ >
122+ )
123+ } ;
116124
117125export default PageHeader ;
You can’t perform that action at this time.
0 commit comments