From 71537f37f74029a0e6e19a89045cbf7fdaf7cf00 Mon Sep 17 00:00:00 2001 From: Loup Theron Date: Tue, 20 Aug 2024 14:46:01 +0200 Subject: [PATCH] fix(elements): user ternary --- src/elements/IconButton.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/elements/IconButton.tsx b/src/elements/IconButton.tsx index e418c0e7b..c96945ef2 100644 --- a/src/elements/IconButton.tsx +++ b/src/elements/IconButton.tsx @@ -83,8 +83,9 @@ export function IconButton({ case Accent.SECONDARY: return ( <> - {badgeNumber === undefined && } - {badgeNumber !== undefined && ( + {badgeNumber === undefined ? ( + + ) : ( {badgeNumber} @@ -98,8 +99,9 @@ export function IconButton({ case Accent.TERTIARY: return ( <> - {badgeNumber === undefined && } - {badgeNumber !== undefined && ( + {badgeNumber === undefined ? ( + + ) : ( {badgeNumber} @@ -113,8 +115,9 @@ export function IconButton({ default: return ( <> - {badgeNumber === undefined && } - {badgeNumber !== undefined && ( + {badgeNumber === undefined ? ( + + ) : ( {badgeNumber}