From 35d5cfad731bbb8f2b9b8628f4b98fd0ae69aa09 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 11 Oct 2023 18:36:49 +0100 Subject: [PATCH] Do not allow editing date and merchant of send money --- src/components/MoneyRequestConfirmationList.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index acaa83181bbf..90dc35e21bb2 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -193,6 +193,7 @@ function MoneyRequestConfirmationList(props) { const {translate, toLocaleDigit} = useLocalize(); const isTypeRequest = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST; + const isTypeSend = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND; const {unit, rate, currency} = props.mileageRate; const distance = lodashGet(transaction, 'routes.route0.distance', 0); @@ -210,6 +211,10 @@ function MoneyRequestConfirmationList(props) { const [shouldExpandFields, toggleShouldExpandFields] = useReducer((state) => !state, false); const shouldShowAllFields = props.isDistanceRequest || shouldExpandFields || !shouldShowSmartScanFields; + // In Send Money flow, we don't allow the Merchant or Date to be edited. + const shouldShowDate = shouldShowAllFields && !isTypeSend; + const shouldShowMerchant = shouldShowAllFields && !isTypeSend; + // Fetches the first tag list of the policy const policyTag = PolicyUtils.getTag(props.policyTags); const policyTagList = lodashGet(policyTag, 'tags', {}); @@ -549,7 +554,7 @@ function MoneyRequestConfirmationList(props) { )} {shouldShowAllFields && ( <> - {shouldShowSmartScanFields && ( + {shouldShowDate && ( )} - {shouldShowSmartScanFields && ( + {shouldShowMerchant && (