You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment Aug 4] [P2P in E.cash] Add the Balance Badge to the Payments Settings Option #4171
I will update the MenuItem Component to Show an optional Badge near the arrow based on the prop badgeText.
We will get the balance from the ONYX.USER_WALLET.balance.
In the MenuItem Array we will check if the payments item is rendered show the balance. We have a unique translateKey but we can also add another key for matching purposes if we don't want to use the translateKey for matching.
4. We will show the formatted balance in the component with currency Sign. Number(props.userWallet.balance).toFixed(2);
#Question:
Do we need to show only $ or we have to get the user's default currency from somewhere?
e.g.
We can get it from personalDetails
// The personal details of the person who is logged in
myPersonalDetails: PropTypes.shape({
// Preferred Currency Code of the current user
preferredCurrencyCode: PropTypes.string,
// Currency Symbol of the Preferred Currency
preferredCurrencySymbol: PropTypes.string,
}),
```
@parasharrajat your proposal looks good, I've invited you to the Upwork job. Going to tag @stitesExpensify to confirm what the currency symbol should be set to here.
It should always be in USD, since users without a US bank account/SSN do not qualify for the Wallet. Pulling from the doc, we also limit who sees the badge in the first place:
All users with a USD personal policy currency will see the badge. Users with a non-USD personal policy currency will not see the balance badge unless they have upgraded to an Active wallet (i.e. international user that also has a SSN, and thus qualifies for an Active wallet)
changed the title [-][P2P in E.cash] Add the Balance Badge to the Payments Settings Option[/-][+][HOLD for payment Aug 4] [P2P in E.cash] Add the Balance Badge to the Payments Settings Option[/+]on Jul 28, 2021
Activity
parasharrajat commentedon Jul 22, 2021
This is Straightforward.
Badgenear the arrow based on the propbadgeText.ONYX.USER_WALLET.balance.translateKeybut we can also add another key for matching purposes if we don't want to use the translateKey for matching.App/src/pages/settings/InitialPage.js
Line 177 in 7e395c5
4. We will show the formatted balance in the component with currency Sign.
Number(props.userWallet.balance).toFixed(2);#Question:
e.g.
We can get it from personalDetails
haseeb-islam commentedon Jul 23, 2021
function currencyFormat(num) {
return '$' + num.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}
OutPut will be = $2,665.00
Jag96 commentedon Jul 23, 2021
@parasharrajat your proposal looks good, I've invited you to the Upwork job. Going to tag @stitesExpensify to confirm what the currency symbol should be set to here.
arpitdeveloper commentedon Jul 23, 2021
stitesExpensify commentedon Jul 23, 2021
Hmm @kevinksullivan Is the wallet balance always in USD? Or should we localize it?
kevinksullivan commentedon Jul 26, 2021
It should always be in USD, since users without a US bank account/SSN do not qualify for the Wallet. Pulling from the doc, we also limit who sees the badge in the first place:
parasharrajat commentedon Jul 26, 2021
Great @kevinksullivan. that's what I assumed initially. PR is ready for review now.
[-][P2P in E.cash] Add the Balance Badge to the Payments Settings Option[/-][+][HOLD for payment Aug 4] [P2P in E.cash] Add the Balance Badge to the Payments Settings Option[/+]Jag96 commentedon Aug 4, 2021
Paid!