@@ -3,10 +3,9 @@ import type {ImageContentFit} from 'expo-image';
3
3
import type { ForwardedRef , ReactNode } from 'react' ;
4
4
import React , { forwardRef , useContext , useMemo } from 'react' ;
5
5
import type { GestureResponderEvent , StyleProp , TextStyle , ViewStyle } from 'react-native' ;
6
- import { StyleSheet , View } from 'react-native' ;
6
+ import { View } from 'react-native' ;
7
7
import type { AnimatedStyle } from 'react-native-reanimated' ;
8
8
import type { ValueOf } from 'type-fest' ;
9
- import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle' ;
10
9
import useStyleUtils from '@hooks/useStyleUtils' ;
11
10
import useTheme from '@hooks/useTheme' ;
12
11
import useThemeStyles from '@hooks/useThemeStyles' ;
@@ -72,6 +71,9 @@ type MenuItemBaseProps = {
72
71
/** Used to apply offline styles to child text components */
73
72
style ?: StyleProp < ViewStyle > ;
74
73
74
+ /** Outer wrapper styles */
75
+ outerWrapperStyle ?: StyleProp < ViewStyle > ;
76
+
75
77
/** Any additional styles to apply */
76
78
wrapperStyle ?: StyleProp < ViewStyle > ;
77
79
@@ -150,9 +152,6 @@ type MenuItemBaseProps = {
150
152
/** Whether item is focused or active */
151
153
focused ?: boolean ;
152
154
153
- /** Whether item is highlighted */
154
- highlighted ?: boolean ;
155
-
156
155
/** Should we disable this menu item? */
157
156
disabled ?: boolean ;
158
157
@@ -261,6 +260,7 @@ function MenuItem(
261
260
badgeText,
262
261
style,
263
262
wrapperStyle,
263
+ outerWrapperStyle,
264
264
containerStyle,
265
265
titleStyle,
266
266
hoverAndPressStyle,
@@ -290,7 +290,6 @@ function MenuItem(
290
290
success = false ,
291
291
focused = false ,
292
292
disabled = false ,
293
- highlighted = false ,
294
293
title,
295
294
subtitle,
296
295
shouldShowBasicTitle,
@@ -330,13 +329,8 @@ function MenuItem(
330
329
const StyleUtils = useStyleUtils ( ) ;
331
330
const combinedStyle = [ style , styles . popoverMenuItem ] ;
332
331
const { isSmallScreenWidth} = useWindowDimensions ( ) ;
333
- const flattenedWrapperStyles = StyleSheet . flatten ( wrapperStyle ) ;
334
- const animatedHighlightStyle = useAnimatedHighlightStyle ( {
335
- shouldHighlight : highlighted ,
336
- height : flattenedWrapperStyles ?. height ? Number ( flattenedWrapperStyles . height ) : styles . sectionMenuItem . height ,
337
- borderRadius : flattenedWrapperStyles ?. borderRadius ? Number ( flattenedWrapperStyles . borderRadius ) : styles . sectionMenuItem . borderRadius ,
338
- } ) ;
339
332
const { isExecuting, singleExecution, waitForNavigate} = useContext ( MenuItemGroupContext ) ?? { } ;
333
+
340
334
const isDeleted = style && Array . isArray ( style ) ? style . includes ( styles . offlineFeedback . deleted ) : false ;
341
335
const descriptionVerticalMargin = shouldShowDescriptionOnTop ? styles . mb1 : styles . mt1 ;
342
336
const fallbackAvatarSize = viewMode === CONST . OPTION_MODE . COMPACT ? CONST . AVATAR_SIZE . SMALL : CONST . AVATAR_SIZE . DEFAULT ;
@@ -436,7 +430,7 @@ function MenuItem(
436
430
onPressIn = { ( ) => shouldBlockSelection && isSmallScreenWidth && DeviceCapabilities . canUseTouchScreen ( ) && ControlSelection . block ( ) }
437
431
onPressOut = { ControlSelection . unblock }
438
432
onSecondaryInteraction = { onSecondaryInteraction }
439
- wrapperStyle = { animatedHighlightStyle }
433
+ wrapperStyle = { outerWrapperStyle }
440
434
style = { ( { pressed} ) =>
441
435
[
442
436
containerStyle ,
0 commit comments