Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function MoneyRequestPreviewContent({
const isFullySettled = isSettled && !isSettlementOrApprovalPartial;
const isFullyApproved = ReportUtils.isReportApproved(iouReport) && !isSettlementOrApprovalPartial;
const shouldShowRBR = hasNoticeTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold);
const showCashOrCard = isCardTransaction ? translate('iou.card') : translate('iou.cash');
const shouldShowHoldMessage = !(isSettled && !isSettlementOrApprovalPartial) && isOnHold;

/*
Expand Down Expand Up @@ -140,7 +141,7 @@ function MoneyRequestPreviewContent({
};

const getPreviewHeaderText = (): string => {
let message = translate('iou.cash');
let message = showCashOrCard;

Comment on lines +144 to 145

@grgia grgia Jun 12, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should follow the existing pattern here and add a

if (isCardTransaction) {
            message = translate('iou.card');
        }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine as it is. message variable is only used for PreviewHeaderText.

if (isDistanceRequest) {
message = translate('common.distance');
Expand Down Expand Up @@ -363,7 +364,7 @@ function MoneyRequestPreviewContent({
onPressOut={() => ControlSelection.unblock()}
onLongPress={showContextMenu}
shouldUseHapticsOnLongPress
accessibilityLabel={isBillSplit ? translate('iou.split') : translate('iou.cash')}
accessibilityLabel={isBillSplit ? translate('iou.split') : showCashOrCard}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we would just display the message here

accessibilityHint={CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency)}
style={[
styles.moneyRequestPreviewBox,
Expand Down