From dcc4994d7372482eef15e7f0a807cff0caa00ee7 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Wed, 20 Dec 2023 12:37:29 +0100 Subject: [PATCH] Add contentFit prop to MenuItem --- src/components/MenuItem.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index aa36e508cb46..a5e02dccddd3 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -1,4 +1,5 @@ import ExpensiMark from 'expensify-common/lib/ExpensiMark'; +import {ImageContentFit} from 'expo-image'; import React, {ForwardedRef, forwardRef, ReactNode, useEffect, useMemo, useRef, useState} from 'react'; import {GestureResponderEvent, StyleProp, TextStyle, View, ViewStyle} from 'react-native'; import {AnimatedStyle} from 'react-native-reanimated'; @@ -226,6 +227,9 @@ type MenuItemProps = (ResponsiveProps | UnresponsiveProps) & /** Icon should be displayed in its own color */ displayInDefaultIconColor?: boolean; + + /** Determines how the icon should be resized to fit its container */ + contentFit?: ImageContentFit; }; function MenuItem( @@ -287,6 +291,7 @@ function MenuItem( onSecondaryInteraction, titleWithTooltips, displayInDefaultIconColor = false, + contentFit = 'cover', }: MenuItemProps, ref: ForwardedRef, ) { @@ -428,6 +433,7 @@ function MenuItem( {typeof icon !== 'string' && iconType === CONST.ICON_TYPE_ICON && (