Skip to content

Commit 7b9dac8

Browse files
suttergarronej
andauthored
fix: optional title for alert components (#138)
* fix: optional title for alert components * Update src/Alert.tsx Signed-off-by: Joseph Garrone <joseph.garrone.gj@gmail.com> --------- Signed-off-by: Joseph Garrone <joseph.garrone.gj@gmail.com> Co-authored-by: Joseph Garrone <joseph.garrone.gj@gmail.com>
1 parent b5fa84e commit 7b9dac8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Alert.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ export const Alert = memo(
158158
ref={ref}
159159
{...rest}
160160
>
161-
<HtmlTitleTag className={cx(fr.cx("fr-alert__title"), classes.title)}>
162-
{title}
163-
</HtmlTitleTag>
161+
{title !== undefined && (
162+
<HtmlTitleTag className={cx(fr.cx("fr-alert__title"), classes.title)}>
163+
{title}
164+
</HtmlTitleTag>
165+
)}
164166
<p className={classes.description}>{description}</p>
165167
{isClosable && (
166168
<button

0 commit comments

Comments
 (0)