Skip to content

Commit

Permalink
Merge pull request #45972 from parasharrajat/parasharrajat/fix-confir…
Browse files Browse the repository at this point in the history
…m-distance

Prevent editing distance field on the duplicate confirm page
  • Loading branch information
mountiny authored Jul 25, 2024
2 parents ac56415 + 9f650ba commit b1db3ec
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ function MoneyRequestView({
<MenuItemWithTopDescription
description={translate('common.distance')}
title={getPendingFieldAction('waypoints') ? translate('iou.fieldPending') : distanceToDisplay}
interactive={canEditDistance}
shouldShowRightIcon={canEditDistance}
interactive={canEditDistance && !readonly}
shouldShowRightIcon={canEditDistance && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DISTANCE.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))
Expand All @@ -352,8 +352,8 @@ function MoneyRequestView({
<MenuItemWithTopDescription
description={translate('common.distance')}
title={transactionMerchant}
interactive={canEditDistance}
shouldShowRightIcon={canEditDistance}
interactive={canEditDistance && !readonly}
shouldShowRightIcon={canEditDistance && !readonly}
titleStyle={styles.flex1}
onPress={() => Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DISTANCE.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))}
/>
Expand Down Expand Up @@ -402,7 +402,7 @@ function MoneyRequestView({
description={name ?? translate('common.tag')}
title={TransactionUtils.getTagForDisplay(updatedTransaction ?? transaction, index)}
interactive={canEdit && !readonly}
shouldShowRightIcon={canEdit}
shouldShowRightIcon={canEdit && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAG.getRoute(CONST.IOU.ACTION.EDIT, iouType, orderWeight, transaction?.transactionID ?? '', report?.reportID ?? '-1'))
Expand Down Expand Up @@ -497,7 +497,7 @@ function MoneyRequestView({
description={amountDescription}
titleStyle={styles.textHeadlineH2}
interactive={canEditAmount && !readonly}
shouldShowRightIcon={canEditAmount}
shouldShowRightIcon={canEditAmount && !readonly}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_AMOUNT.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))
}
Expand All @@ -511,7 +511,7 @@ function MoneyRequestView({
shouldParseTitle
title={updatedTransactionDescription ?? transactionDescription}
interactive={canEdit && !readonly}
shouldShowRightIcon={canEdit}
shouldShowRightIcon={canEdit && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))
Expand All @@ -530,7 +530,7 @@ function MoneyRequestView({
description={translate('common.merchant')}
title={updatedTransaction?.modifiedMerchant ?? merchantTitle}
interactive={canEditMerchant && !readonly}
shouldShowRightIcon={canEditMerchant}
shouldShowRightIcon={canEditMerchant && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_MERCHANT.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))
Expand All @@ -547,7 +547,7 @@ function MoneyRequestView({
description={translate('common.date')}
title={transactionDate}
interactive={canEditDate && !readonly}
shouldShowRightIcon={canEditDate}
shouldShowRightIcon={canEditDate && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DATE.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1' ?? '-1'))
Expand All @@ -562,7 +562,7 @@ function MoneyRequestView({
description={translate('common.category')}
title={updatedTransaction?.category ?? transactionCategory}
interactive={canEdit && !readonly}
shouldShowRightIcon={canEdit}
shouldShowRightIcon={canEdit && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))
Expand All @@ -589,7 +589,7 @@ function MoneyRequestView({
title={taxRateTitle ?? ''}
description={taxRatesDescription}
interactive={canEditTaxFields && !readonly}
shouldShowRightIcon={canEditTaxFields}
shouldShowRightIcon={canEditTaxFields && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAX_RATE.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID ?? '-1', report?.reportID ?? '-1'))
Expand All @@ -605,7 +605,7 @@ function MoneyRequestView({
title={formattedTaxAmount ? formattedTaxAmount.toString() : ''}
description={translate('iou.taxAmount')}
interactive={canEditTaxFields && !readonly}
shouldShowRightIcon={canEditTaxFields}
shouldShowRightIcon={canEditTaxFields && !readonly}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(
Expand Down

0 comments on commit b1db3ec

Please sign in to comment.