Skip to content

Commit 8622666

Browse files
committed
add hover icon fill to back button item
1 parent ec099e2 commit 8622666

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/components/MenuItem.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type MenuItemBaseProps = {
104104
descriptionTextStyle?: StyleProp<TextStyle>;
105105

106106
/** The fill color to pass into the icon. */
107-
iconFill?: string;
107+
iconFill?: string | ((isHovered: boolean) => string);
108108

109109
/** Secondary icon to display on the left side of component, right of the icon */
110110
secondaryIcon?: IconAsset;
@@ -761,12 +761,14 @@ function MenuItem(
761761
fill={
762762
displayInDefaultIconColor
763763
? undefined
764-
: (iconFill ??
765-
StyleUtils.getIconFillColor(
766-
getButtonState(focused || isHovered, pressed, success, disabled, interactive),
767-
true,
768-
isPaneMenu,
769-
))
764+
: typeof iconFill === 'function'
765+
? iconFill(isHovered)
766+
: (iconFill ??
767+
StyleUtils.getIconFillColor(
768+
getButtonState(focused || isHovered, pressed, success, disabled, interactive),
769+
true,
770+
isPaneMenu,
771+
))
770772
}
771773
additionalStyles={additionalIconStyles}
772774
/>

src/components/PopoverMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function BasePopoverMenu({
291291
<MenuItem
292292
key={previouslySelectedItem?.text}
293293
icon={Expensicons.BackArrow}
294-
iconFill={theme.icon}
294+
iconFill={(isHovered) => (isHovered ? theme.iconHovered : theme.icon)}
295295
style={hasBackButtonText ? styles.pv0 : undefined}
296296
additionalIconStyles={[{width: variables.iconSizeSmall, height: variables.iconSizeSmall}, styles.opacitySemiTransparent, styles.mr1]}
297297
title={hasBackButtonText ? previouslySelectedItem?.backButtonText : previouslySelectedItem?.text}

0 commit comments

Comments
 (0)