From 934d43eca1c1e90cb37b07ac1386e7325c2cdc45 Mon Sep 17 00:00:00 2001 From: Filip Hlavac Date: Thu, 9 Jan 2025 15:58:41 +0100 Subject: [PATCH] fix: make content header subtitle optional --- packages/module/src/ContentHeader/ContentHeader.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/module/src/ContentHeader/ContentHeader.tsx b/packages/module/src/ContentHeader/ContentHeader.tsx index a3fd94c0..ab4cf3d3 100644 --- a/packages/module/src/ContentHeader/ContentHeader.tsx +++ b/packages/module/src/ContentHeader/ContentHeader.tsx @@ -25,8 +25,8 @@ export interface PageHeaderLinkProps extends ButtonProps { export interface ContentHeaderProps extends React.PropsWithChildren { /** 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) */ @@ -102,9 +102,11 @@ export const ContentHeader: React.FunctionComponent - - {subtitle} - + {subtitle && ( + + {subtitle} + + )} {linkProps && (