Skip to content

Commit

Permalink
Merge pull request #43271 from cretadn22/hide-amount-in-submit-button…
Browse files Browse the repository at this point in the history
…-within-quick-action

Hide amount in submit button if skip confirmtion page
  • Loading branch information
Beamanator authored Jun 10, 2024
2 parents 763047d + b5aa81b commit 60530f6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ export default {
finished: 'Finished',
sendInvoice: ({amount}: RequestAmountParams) => `Send ${amount} invoice`,
submitAmount: ({amount}: RequestAmountParams) => `submit ${amount}`,
trackAmount: ({amount}: RequestAmountParams) => `track ${amount}`,
submittedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `submitted ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
splitAmount: ({amount}: SplitAmountParams) => `split ${amount}`,
Expand Down
1 change: 0 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ export default {
finished: 'Finalizado',
sendInvoice: ({amount}: RequestAmountParams) => `Enviar factura de ${amount}`,
submitAmount: ({amount}: RequestAmountParams) => `solicitar ${amount}`,
trackAmount: ({amount}: RequestAmountParams) => `seguimiento de ${amount}`,
submittedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `solicitó ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
splitAmount: ({amount}: SplitAmountParams) => `dividir ${amount}`,
Expand Down
14 changes: 1 addition & 13 deletions src/pages/iou/MoneyRequestAmountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,7 @@ function MoneyRequestAmountForm(
);

const buttonText: string = useMemo(() => {
const currentAmount = moneyRequestAmountInput.current?.getAmount() ?? '';
if (skipConfirmation) {
if (currentAmount !== '') {
const currencyAmount = CurrencyUtils.convertToDisplayString(CurrencyUtils.convertToBackendAmount(Number.parseFloat(currentAmount)), currency) ?? '';
let text = translate('iou.submitAmount', {amount: currencyAmount});
if (iouType === CONST.IOU.TYPE.SPLIT) {
text = translate('iou.splitAmount', {amount: currencyAmount});
} else if (iouType === CONST.IOU.TYPE.TRACK) {
text = translate('iou.trackAmount', {amount: currencyAmount});
}
return text[0].toUpperCase() + text.slice(1);
}

if (iouType === CONST.IOU.TYPE.SPLIT) {
return translate('iou.splitExpense');
}
Expand All @@ -250,7 +238,7 @@ function MoneyRequestAmountForm(
return translate('iou.submitExpense');
}
return isEditing ? translate('common.save') : translate('common.next');
}, [skipConfirmation, iouType, currency, isEditing, translate]);
}, [skipConfirmation, iouType, isEditing, translate]);

const canUseTouchScreen = DeviceCapabilities.canUseTouchScreen();

Expand Down

0 comments on commit 60530f6

Please sign in to comment.