From a587ac97f3844f323b6736e80d6b8cabca871724 Mon Sep 17 00:00:00 2001 From: Alexey Sudilovskiy Date: Thu, 2 Nov 2023 16:36:05 +0100 Subject: [PATCH] chore: simplify conditional --- src/components/DropdownMenu/DropdownMenuItem.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/DropdownMenu/DropdownMenuItem.tsx b/src/components/DropdownMenu/DropdownMenuItem.tsx index 8141c7ae39..41f84eb79e 100644 --- a/src/components/DropdownMenu/DropdownMenuItem.tsx +++ b/src/components/DropdownMenu/DropdownMenuItem.tsx @@ -92,13 +92,11 @@ export const DropdownMenuItem = ({ }; }, [props.extraProps, closeSubmenu, hasSubmenu, openSubmenu]); - let iconEnd = props.iconEnd ? props.iconEnd : null; - - if (hasSubmenu) { - iconEnd = ( - - ); - } + const iconEnd = hasSubmenu ? ( + + ) : ( + props.iconEnd + ); return (