Skip to content

Commit ff50b3f

Browse files
authored
fix: make ContentHeader subtitle optional (#542)
1 parent 56aef83 commit ff50b3f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/module/src/ContentHeader/ContentHeader.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export interface PageHeaderLinkProps extends ButtonProps {
2525
export interface ContentHeaderProps {
2626
/** Title for content header */
2727
title: string;
28-
/** Subtitle for content header */
29-
subtitle: string;
28+
/** Optional subtitle for content header */
29+
subtitle?: string;
3030
/** Optional link below subtitle */
3131
linkProps?: PageHeaderLinkProps;
3232
/** Optional icon for content header (appears to the left of the content header's title with a divider) */
@@ -97,9 +97,11 @@ export const ContentHeader: React.FunctionComponent<React.PropsWithChildren<Cont
9797
</SplitItem>
9898
)}
9999
</Split>
100-
<Content component="p" ouiaId={`${ouiaId}-subtitle`}>
101-
{subtitle}
102-
</Content>
100+
{subtitle && (
101+
<Content component="p" ouiaId={`${ouiaId}-subtitle`}>
102+
{subtitle}
103+
</Content>
104+
)}
103105
{linkProps && (
104106
<Button variant={ButtonVariant.link} component="a" ouiaId={`${ouiaId}-link-button`} isInline icon={isExternal ? <ExternalLinkAltIcon className='pf-v6-u-ml-sm' /> : null} iconPosition="end" {...linkRestProps}>
105107
{linkProps.label}

0 commit comments

Comments
 (0)