Skip to content

Commit

Permalink
Merge pull request #16734 from Expensify/jasper-moneyRequestModalHead…
Browse files Browse the repository at this point in the history
…erTextUpdate

Rename modal header text
  • Loading branch information
luacmartins authored Apr 11, 2023
2 parents 7458fe3 + 662fd4e commit eabb983
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export default {
},
iou: {
amount: 'Amount',
cash: 'Cash',
participants: 'Participants',
splitBill: 'Split bill',
requestMoney: 'Request money',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export default {
},
iou: {
amount: 'Importe',
cash: 'Efectivo',
participants: 'Participantes',
splitBill: 'Dividir factura',
requestMoney: 'Pedir dinero',
Expand Down
26 changes: 3 additions & 23 deletions src/pages/iou/MoneyRequestModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,35 +194,15 @@ const MoneyRequestModal = (props) => {
* @returns {String}
*/
const titleForStep = useMemo(() => {
const isSendingMoney = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND;
if (currentStepIndex === 1 || currentStepIndex === 2) {
const formattedAmount = props.numberFormat(
amount, {
style: 'currency',
currency: props.iou.selectedCurrencyCode,
},
);
if (isSendingMoney) {
return props.translate('iou.send', {
amount: formattedAmount,
});
}
return props.translate(
props.hasMultipleParticipants ? 'iou.split' : 'iou.request', {
amount: formattedAmount,
},
);
}
if (currentStepIndex === 0) {
if (isSendingMoney) {
if (props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND) {
return props.translate('iou.sendMoney');
}
return props.translate(props.hasMultipleParticipants ? 'iou.splitBill' : 'iou.requestMoney');
}

return props.translate(steps[currentStepIndex]) || '';
return props.translate('iou.cash');
// eslint-disable-next-line react-hooks/exhaustive-deps -- props does not need to be a dependency as it will always exist
}, [amount, currentStepIndex, props.hasMultipleParticipants, props.iou.selectedCurrencyCode, props.iouType, props.numberFormat, steps]);
}, [currentStepIndex, props.translate]);

/**
* Navigate to the previous request step if possible
Expand Down

0 comments on commit eabb983

Please sign in to comment.