Skip to content

Commit e45bdcd

Browse files
committed
fix: add styling to right icon in menu item
1 parent 38b1e0e commit e45bdcd

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/components/MenuItem.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ type MenuItemBaseProps = {
377377

378378
/** Report ID for the avatar on the right */
379379
rightIconReportID?: string;
380+
381+
/** Whether the menu item contains nested submenu items. */
382+
hasSubMenuItems?: boolean;
380383
};
381384

382385
type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps;
@@ -498,6 +501,7 @@ function MenuItem(
498501
shouldTeleportPortalToModalLayer,
499502
copyValue,
500503
plaidUrl,
504+
hasSubMenuItems = false,
501505
}: MenuItemProps,
502506
ref: PressableRef,
503507
) {
@@ -936,11 +940,14 @@ function MenuItem(
936940
styles.pointerEventsAuto,
937941
StyleUtils.getMenuItemIconStyle(isCompact),
938942
disabled && !shouldUseDefaultCursorWhenDisabled && styles.cursorDisabled,
943+
hasSubMenuItems && styles.opacitySemiTransparent,
939944
]}
940945
>
941946
<Icon
942947
src={iconRight}
943948
fill={StyleUtils.getIconFillColor(getButtonState(focused || isHovered, pressed, success, disabled, interactive))}
949+
width={hasSubMenuItems ? variables.iconSizeSmall : variables.iconSizeNormal}
950+
height={hasSubMenuItems ? variables.iconSizeSmall : variables.iconSizeNormal}
944951
/>
945952
</View>
946953
)}

src/components/PopoverMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ function BasePopoverMenu({
340340
titleStyle={StyleSheet.flatten([styles.flex1, item.titleStyle])}
341341
// Spread other props dynamically
342342
{...menuItemProps}
343+
hasSubMenuItems={!!subMenuItems?.length}
343344
shouldShowLoadingSpinnerIcon={shouldShowLoadingSpinnerIcon}
344345
/>
345346
</OfflineWithFeedback>

0 commit comments

Comments
 (0)