diff --git a/src/CONST.js b/src/CONST.js
index 41c37009e08d..b88f0ec2a863 100755
--- a/src/CONST.js
+++ b/src/CONST.js
@@ -2202,6 +2202,8 @@ const CONST = {
PATHS_TO_TREAT_AS_EXTERNAL: [
'NewExpensify.dmg',
],
+
+ CONCIERGE_TRAVEL_URL: 'https://community.expensify.com/discussion/7066/introducing-concierge-travel',
};
export default CONST;
diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js
index 85101babf5cb..c3e823715a33 100644
--- a/src/components/MenuItem.js
+++ b/src/components/MenuItem.js
@@ -1,8 +1,6 @@
import _ from 'underscore';
import React from 'react';
-import {
- View, Pressable,
-} from 'react-native';
+import {View} from 'react-native';
import Text from './Text';
import styles from '../styles/styles';
import * as StyleUtils from '../styles/StyleUtils';
@@ -18,9 +16,14 @@ 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 = {
@@ -46,11 +49,13 @@ 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) => {
@@ -71,7 +76,7 @@ const MenuItem = (props) => {
]);
return (
- {
if (props.disabled) {
return;
@@ -83,12 +88,16 @@ 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),
..._.isArray(props.wrapperStyle) ? props.wrapperStyle : [props.wrapperStyle],
])}
disabled={props.disabled}
+ ref={props.forwardedRef}
>
{({hovered, pressed}) => (
<>
@@ -211,12 +220,14 @@ const MenuItem = (props) => {
>
)}
-
+
);
};
MenuItem.propTypes = propTypes;
MenuItem.defaultProps = defaultProps;
MenuItem.displayName = 'MenuItem';
-
-export default MenuItem;
+export default withWindowDimensions(React.forwardRef((props, ref) => (
+ // eslint-disable-next-line react/jsx-props-no-spreading
+
+)));
diff --git a/src/components/MenuItemList.js b/src/components/MenuItemList.js
index e442d3766893..fe7d40b582f8 100644
--- a/src/components/MenuItemList.js
+++ b/src/components/MenuItemList.js
@@ -3,6 +3,8 @@ 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 */
@@ -12,17 +14,38 @@ const defaultProps = {
menuItems: [],
};
-const MenuItemList = props => (
- <>
- {_.map(props.menuItems, menuItemProps => (
-
- ))}
- >
-);
+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 => (
+