Skip to content

Commit

Permalink
chore: simplify conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed Nov 2, 2023
1 parent 6664f4b commit a587ac9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/DropdownMenu/DropdownMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@ export const DropdownMenuItem = <T,>({
};
}, [props.extraProps, closeSubmenu, hasSubmenu, openSubmenu]);

let iconEnd = props.iconEnd ? props.iconEnd : null;

if (hasSubmenu) {
iconEnd = (
<Icon data={ChevronRight} size={10} className={cnDropdownMenu('sub-menu-arrow')} />
);
}
const iconEnd = hasSubmenu ? (
<Icon data={ChevronRight} size={10} className={cnDropdownMenu('sub-menu-arrow')} />
) : (
props.iconEnd
);

return (
<React.Fragment>
Expand Down

0 comments on commit a587ac9

Please sign in to comment.