Skip to content

Commit

Permalink
fix: make ContentHeader subtitle optional (#542)
Browse files Browse the repository at this point in the history
fhlavac authored Jan 10, 2025
1 parent 56aef83 commit ff50b3f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/module/src/ContentHeader/ContentHeader.tsx
Original file line number Diff line number Diff line change
@@ -25,8 +25,8 @@ export interface PageHeaderLinkProps extends ButtonProps {
export interface ContentHeaderProps {
/** Title for content header */
title: string;
/** Subtitle for content header */
subtitle: string;
/** Optional subtitle for content header */
subtitle?: string;
/** Optional link below subtitle */
linkProps?: PageHeaderLinkProps;
/** 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
</SplitItem>
)}
</Split>
<Content component="p" ouiaId={`${ouiaId}-subtitle`}>
{subtitle}
</Content>
{subtitle && (
<Content component="p" ouiaId={`${ouiaId}-subtitle`}>
{subtitle}
</Content>
)}
{linkProps && (
<Button variant={ButtonVariant.link} component="a" ouiaId={`${ouiaId}-link-button`} isInline icon={isExternal ? <ExternalLinkAltIcon className='pf-v6-u-ml-sm' /> : null} iconPosition="end" {...linkRestProps}>
{linkProps.label}

0 comments on commit ff50b3f

Please sign in to comment.