1- import MenuItem from '@components/MenuItem' ;
1+ import MenuItem from '@components/MenuItem/compound' ;
2+ import getContextMenuAccessibilityHint from '@components/utils/getContextMenuAccessibilityHint' ;
3+ import getContextMenuAccessibilityProps from '@components/utils/getContextMenuAccessibilityProps' ;
4+
5+ import useLocalize from '@hooks/useLocalize' ;
26
37import { showContextMenu } from '@pages/inbox/report/ContextMenu/ReportActionContextMenu' ;
48
@@ -21,6 +25,7 @@ type SettingsMenuItemProps = {
2125} ;
2226
2327function SettingsMenuItem ( { item, isFocused, keyTitle, isExecuting, isScreenFocused, onPress, wrapperStyle} : SettingsMenuItemProps ) {
28+ const { translate} = useLocalize ( ) ;
2429 const popoverAnchor = useRef ( null ) ;
2530
2631 const onSecondaryInteraction = item . link
@@ -49,35 +54,48 @@ function SettingsMenuItem({item, isFocused, keyTitle, isExecuting, isScreenFocus
4954 }
5055 : undefined ;
5156
57+ const combinedAccessibilityLabel = [ keyTitle , item . brickRoadIndicator ? translate ( 'common.yourReviewIsRequired' ) : '' ] . filter ( Boolean ) . join ( '. ' ) ;
58+ const contextMenuHint = item . link ? getContextMenuAccessibilityHint ( { translate} ) : undefined ;
59+ const { accessibilityLabel, accessibilityHint} = getContextMenuAccessibilityProps ( { accessibilityLabel : combinedAccessibilityLabel , contextMenuHint} ) ;
60+
61+ const hasTrailing = ! ! item . badgeText || ! ! item . brickRoadIndicator || ! ! item . iconRight ;
62+
5263 return (
5364 < MenuItem
54- wrapperStyle = { wrapperStyle }
55- title = { keyTitle }
56- icon = { item . icon }
57- iconType = { item . iconType }
58- disabled = { isExecuting }
59- onPress = { onPress }
60- iconStyles = { item . iconStyles }
61- badgeText = { item . badgeText }
62- badgeStyle = { item . badgeStyle }
63- isBadgeSuccess = { item . isBadgeSuccess }
64- isBadgeStrong = { item . isBadgeStrong }
65- isBadgeCondensed = { item . isBadgeCondensed }
66- fallbackIcon = { item . fallbackIcon }
67- brickRoadIndicator = { item . brickRoadIndicator }
68- shouldStackHorizontally = { item . shouldStackHorizontally }
6965 ref = { popoverAnchor }
70- shouldBlockSelection = { ! ! item . link }
66+ style = { wrapperStyle }
67+ onPress = { onPress }
7168 onSecondaryInteraction = { onSecondaryInteraction }
72- shouldShowContextMenuHint = { ! ! item . link }
69+ disabled = { isExecuting }
7370 focused = { isFocused }
7471 role = { CONST . ROLE . TAB }
75- isPaneMenu
72+ accessibilityLabel = { accessibilityLabel }
73+ accessibilityHint = { accessibilityHint }
7674 sentryLabel = { item . sentryLabel }
77- iconRight = { item . iconRight }
78- shouldShowRightIcon = { item . shouldShowRightIcon }
79- shouldIconUseAutoWidthStyle
80- />
75+ >
76+ < MenuItem . Row >
77+ < MenuItem . Icon
78+ src = { item . icon }
79+ variant = { CONST . MENU_ITEM . ICON_VARIANT . COMPACT }
80+ />
81+ < MenuItem . Content >
82+ < MenuItem . Title > { keyTitle } </ MenuItem . Title >
83+ </ MenuItem . Content >
84+ { hasTrailing && (
85+ < MenuItem . Trailing >
86+ { ! ! item . badgeText && (
87+ < MenuItem . Badge
88+ text = { item . badgeText }
89+ success = { item . isBadgeSuccess }
90+ isCondensed = { item . isBadgeCondensed }
91+ />
92+ ) }
93+ { ! ! item . brickRoadIndicator && < MenuItem . BrickRoadIndicator status = { item . brickRoadIndicator } /> }
94+ { ! ! item . iconRight && < MenuItem . Chevron src = { item . iconRight } /> }
95+ </ MenuItem . Trailing >
96+ ) }
97+ </ MenuItem . Row >
98+ </ MenuItem >
8199 ) ;
82100}
83101
0 commit comments