-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add the currency sign to IOU request flow #2992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@iwiznia FYI conflicts |
| const buttonText = this.props.translate( | ||
| this.props.hasMultipleParticipants ? 'common.split' : 'iou.request', { | ||
| amount: this.props.numberFormat( | ||
| this.props.iouAmount, | ||
| {style: 'currency', currency: this.props.selectedCurrency}, | ||
| ), | ||
| }, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've got a condition, translation, and number format all in one chunk. Maybe separating out amount would simplify this statement a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why adding more variable is simpler, the amount of code is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at it like this, I'm not sure it offers too much of an improvement 🤷
const phrase = this.props.hasMultipleParticipants ? 'common.split' : 'iou.request';
const variables = {
amount: this.props.numberFormat(
this.props.iouAmount,
{style: 'currency', currency: this.props.selectedCurrency},
),
};
const buttonText = this.props.translate(phrase, variables);
src/languages/en.js
Outdated
| to: 'To', | ||
| optional: 'Optional', | ||
| split: 'Split', | ||
| split: ({amount}) => `Split ${amount}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it shouldn't be common anymore, as it must have an amount. It should be listed beneath iou.request IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that it has an amount does not make a difference. We are using this in 3 places, so it is pretty common to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see iou.request used in the same places as common.split - both in IOUConfirmationList.js and IOUModal.js.
My opinion is that adding an ${amount} in the text makes it very iou-related so I'd agree with Jules.
| amount: this.props.numberFormat( | ||
| this.state.amount, { | ||
| style: 'currency', | ||
| currency: this.state.selectedCurrency, | ||
| }, | ||
| ), | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Separating this into two steps would be a lot simpler.
Julesssss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested a few changes
|
Updated |
|
Updated |
Beamanator
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works well on Desktop & iOS 👍
Details
Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/164533
Tests
Request Money
Split Bill
Tested On