Skip to content

Commit 7533089

Browse files
committed
BannerBase: use nullish check for title when spacing description to handle numeric 0 (React + RN)
1 parent a8792e8 commit 7533089

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

packages/design-system-react-native/src/components/BannerBase/BannerBase.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ export const BannerBase: React.FC<BannerBaseProps> = ({
9292
))}
9393

9494
{description !== null && description !== undefined && (
95-
<Box twClassName={title ? 'mt-1' : undefined}>
95+
<Box
96+
twClassName={
97+
title !== null && title !== undefined ? 'mt-1' : undefined
98+
}
99+
>
96100
{isTextContent(description) ? (
97101
<Text variant={TextVariant.BodySm} {...descriptionProps}>
98102
{description}

packages/design-system-react/src/components/BannerBase/BannerBase.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(
8282
))}
8383

8484
{description !== null && description !== undefined && (
85-
<Box className={title ? 'mt-1' : undefined}>
85+
<Box
86+
className={
87+
title !== null && title !== undefined ? 'mt-1' : undefined
88+
}
89+
>
8690
{isTextContent(description) ? (
8791
<Text variant={TextVariant.BodySm} {...descriptionProps}>
8892
{description}

0 commit comments

Comments
 (0)