diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js
index 070b639c2796..c8dc826a316c 100644
--- a/src/components/MenuItem.js
+++ b/src/components/MenuItem.js
@@ -1,6 +1,8 @@
import _ from 'underscore';
import React from 'react';
-import {View} from 'react-native';
+import {
+ View, Pressable,
+} from 'react-native';
import Text from './Text';
import styles from '../styles/styles';
import * as StyleUtils from '../styles/StyleUtils';
@@ -16,14 +18,9 @@ import colors from '../styles/colors';
import variables from '../styles/variables';
import MultipleAvatars from './MultipleAvatars';
import * as defaultWorkspaceAvatars from './Icon/WorkspaceDefaultAvatars';
-import PressableWithSecondaryInteraction from './PressableWithSecondaryInteraction';
-import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
-import * as DeviceCapabilities from '../libs/DeviceCapabilities';
-import ControlSelection from '../libs/ControlSelection';
const propTypes = {
...menuItemPropTypes,
- ...windowDimensionsPropTypes,
};
const defaultProps = {
@@ -49,13 +46,11 @@ const defaultProps = {
subtitle: undefined,
iconType: CONST.ICON_TYPE_ICON,
onPress: () => {},
- onSecondaryInteraction: undefined,
interactive: true,
fallbackIcon: Expensicons.FallbackAvatar,
brickRoadIndicator: '',
floatRightAvatars: [],
shouldStackHorizontally: false,
- shouldBlockSelection: false,
};
const MenuItem = (props) => {
@@ -76,7 +71,7 @@ const MenuItem = (props) => {
]);
return (
- {
if (props.disabled) {
return;
@@ -88,9 +83,6 @@ const MenuItem = (props) => {
props.onPress(e);
}}
- onPressIn={() => props.shouldBlockSelection && props.isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
- onPressOut={ControlSelection.unblock}
- onSecondaryInteraction={props.onSecondaryInteraction}
style={({hovered, pressed}) => ([
props.style,
StyleUtils.getButtonBackgroundColorStyle(getButtonState(props.focused || hovered, pressed, props.success, props.disabled, props.interactive), true),
@@ -98,7 +90,6 @@ const MenuItem = (props) => {
styles.popoverMaxWidth,
])}
disabled={props.disabled}
- ref={props.forwardedRef}
>
{({hovered, pressed}) => (
<>
@@ -221,14 +212,12 @@ const MenuItem = (props) => {
>
)}
-
+
);
};
MenuItem.propTypes = propTypes;
MenuItem.defaultProps = defaultProps;
MenuItem.displayName = 'MenuItem';
-export default withWindowDimensions(React.forwardRef((props, ref) => (
- // eslint-disable-next-line react/jsx-props-no-spreading
-
-)));
+
+export default MenuItem;
diff --git a/src/components/MenuItemList.js b/src/components/MenuItemList.js
index fe7d40b582f8..e442d3766893 100644
--- a/src/components/MenuItemList.js
+++ b/src/components/MenuItemList.js
@@ -3,8 +3,6 @@ import _ from 'underscore';
import PropTypes from 'prop-types';
import MenuItem from './MenuItem';
import menuItemPropTypes from './menuItemPropTypes';
-import * as ReportActionContextMenu from '../pages/home/report/ContextMenu/ReportActionContextMenu';
-import {CONTEXT_MENU_TYPES} from '../pages/home/report/ContextMenu/ContextMenuActions';
const propTypes = {
/** An array of props that are pass to individual MenuItem components */
@@ -14,38 +12,17 @@ const defaultProps = {
menuItems: [],
};
-const MenuItemList = (props) => {
- let popoverAnchor;
-
- /**
- * Handle the secondary interaction for a menu item.
- *
- * @param {*} link the menu item link or function to get the link
- * @param {Event} e the interaction event
- */
- const secondaryInteraction = (link, e) => {
- if (typeof link === 'function') {
- link().then(url => ReportActionContextMenu.showContextMenu(CONTEXT_MENU_TYPES.LINK, e, url, popoverAnchor));
- } else if (!_.isEmpty(link)) {
- ReportActionContextMenu.showContextMenu(CONTEXT_MENU_TYPES.LINK, e, link, popoverAnchor);
- }
- };
-
- return (
- <>
- {_.map(props.menuItems, menuItemProps => (
-