From 25f4d94cda0c60240382a9f37a03bdecff1eab49 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 9 Feb 2024 10:59:37 -0800 Subject: [PATCH 01/16] Fix text styling/gaps on ReportPreview/MoneyRequestPreview --- .../ReportActionItem/MoneyRequestPreview.tsx | 128 +++++++++--------- .../ReportActionItem/ReportPreview.tsx | 124 +++++++++-------- src/styles/index.ts | 17 ++- 3 files changed, 147 insertions(+), 122 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.tsx b/src/components/ReportActionItem/MoneyRequestPreview.tsx index e89193108d24..2aa2c0047d64 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.tsx +++ b/src/components/ReportActionItem/MoneyRequestPreview.tsx @@ -275,70 +275,76 @@ function MoneyRequestPreview({ {isEmptyObject(transaction) && !ReportActionsUtils.isMessageDeleted(action) && action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? ( ) : ( - - - - {getPreviewHeaderText() + (isSettled && !iouReport?.isCancelledIOU ? ` • ${getSettledMessage()}` : '')} - - {!isSettled && hasFieldErrors && ( - - )} - - - - - {displayAmount} - - {ReportUtils.isSettled(iouReport?.reportID) && !isBillSplit && ( - - + + + + + + {getPreviewHeaderText() + (isSettled && !iouReport?.isCancelledIOU ? ` • ${getSettledMessage()}` : '')} + + {!isSettled && hasFieldErrors && ( + + )} + + + + + + {displayAmount} + + {ReportUtils.isSettled(iouReport?.reportID) && !isBillSplit && ( + + + + )} + + {isBillSplit && ( + + + + )} + + + + {!isCurrentUserManager && shouldShowPendingConversionMessage && ( + {translate('iou.pendingConversionMessage')} + )} + {shouldShowDescription && } + {shouldShowMerchant && {merchantOrDescription}} + + {isBillSplit && participantAccountIDs.length > 0 && !!requestAmount && requestAmount > 0 && ( + + {translate('iou.amountEach', { + amount: CurrencyUtils.convertToDisplayString( + IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? ''), + requestCurrency, + ), + })} + + )} + - )} - - {isBillSplit && ( - - - )} - - - - {!isCurrentUserManager && shouldShowPendingConversionMessage && ( - {translate('iou.pendingConversionMessage')} - )} - {shouldShowDescription && } - {shouldShowMerchant && {merchantOrDescription}} - {isBillSplit && participantAccountIDs.length > 0 && !!requestAmount && requestAmount > 0 && ( - - {translate('iou.amountEach', { - amount: CurrencyUtils.convertToDisplayString( - IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? ''), - requestCurrency, - ), - })} - - )} - )} diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 4066776711b1..caa443dba2e9 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -269,70 +269,76 @@ function ReportPreview({ size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS} /> )} - - - - {getPreviewMessage()} - - {!iouSettled && hasErrors && ( - - )} - - - - {getDisplayAmount()} - {ReportUtils.isSettled(iouReportID) && ( - + + + + + + {getPreviewMessage()} + + {!iouSettled && hasErrors && ( + )} + + + + + {getDisplayAmount()} + {ReportUtils.isSettled(iouReportID) && ( + + + + )} + + + {shouldShowSubtitle && ( + + + {previewSubtitle || moneyRequestComment} + + + )} + + {shouldShowSettlementButton && ( + chatReport && iouReport && paymentType && IOU.payMoneyRequest(paymentType, chatReport, iouReport)} + enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS} + addBankAccountRoute={bankAccountRoute} + shouldHidePaymentOptions={!shouldShowPayButton} + shouldShowApproveButton={shouldShowApproveButton} + style={[styles.mt3]} + kycWallAnchorAlignment={{ + horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, + vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, + }} + paymentMethodDropdownAnchorAlignment={{ + horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, + vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, + }} + isDisabled={!canAllowSettlement} + /> + )} + {shouldShowSubmitButton && ( +