From 41ab830cec1206f15015517690be1dfa6b93eef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Tue, 24 Sep 2024 13:36:17 +0200 Subject: [PATCH] Revert "fix: prevent open context menu on money request" --- .../MoneyRequestConfirmationListFooter.tsx | 59 +++++++------------ .../report/ReportActionItemContentCreated.tsx | 6 +- 2 files changed, 24 insertions(+), 41 deletions(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index 62e4f1e8b589..b77e3b993b8d 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -35,7 +35,6 @@ import PDFThumbnail from './PDFThumbnail'; import PressableWithoutFocus from './Pressable/PressableWithoutFocus'; import ReceiptEmptyState from './ReceiptEmptyState'; import ReceiptImage from './ReceiptImage'; -import {ShowContextMenuContext} from './ShowContextMenuContext'; import ShowMoreButton from './ShowMoreButton'; type MoneyRequestConfirmationListFooterProps = { @@ -269,18 +268,6 @@ function MoneyRequestConfirmationListFooter({ const resolvedThumbnail = isLocalFile ? receiptThumbnail : tryResolveUrlFromApiRoot(receiptThumbnail ?? ''); const resolvedReceiptImage = isLocalFile ? receiptImage : tryResolveUrlFromApiRoot(receiptImage ?? ''); - const contextMenuContextValue = useMemo( - () => ({ - anchor: null, - report: undefined, - reportNameValuePairs: undefined, - action: undefined, - checkIfContextMenuActive: () => {}, - isDisabled: true, - }), - [], - ); - const mentionReportContextValue = useMemo(() => ({currentReportID: reportID}), [reportID]); // An intermediate structure that helps us classify the fields as "primary" and "supplementary". @@ -313,31 +300,29 @@ function MoneyRequestConfirmationListFooter({ }, { item: ( - - + - { - Navigation.navigate( - ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRouteWithoutParams(), reportActionID), - ); - }} - style={[styles.moneyRequestMenuItem]} - titleStyle={styles.flex1} - disabled={didConfirm} - interactive={!isReadOnly} - numberOfLinesTitle={2} - /> - - + shouldShowRightIcon={!isReadOnly} + shouldParseTitle + excludedMarkdownRules={!policy ? ['reportMentions'] : []} + title={iouComment} + description={translate('common.description')} + onPress={() => { + Navigation.navigate( + ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRouteWithoutParams(), reportActionID), + ); + }} + style={[styles.moneyRequestMenuItem]} + titleStyle={styles.flex1} + disabled={didConfirm} + interactive={!isReadOnly} + numberOfLinesTitle={2} + /> + ), shouldShow: true, isSupplementary: false, diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index ad40df3d5213..21bb6471f5b1 100644 --- a/src/pages/home/report/ReportActionItemContentCreated.tsx +++ b/src/pages/home/report/ReportActionItemContentCreated.tsx @@ -74,8 +74,6 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans [shouldHideThreadDividerLine, report.reportID, styles.reportHorizontalRule], ); - const contextMenuValue = useMemo(() => ({...contextValue, isDisabled: true}), [contextValue]); - if (ReportActionsUtils.isTransactionThread(parentReportAction)) { const isReversedTransaction = ReportActionsUtils.isReversedTransaction(parentReportAction); @@ -106,7 +104,7 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans } return ( - + - +