Skip to content
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

[HOLD for payment Aug 4] [P2P in E.cash] Add the Balance Badge to the Payments Settings Option #4171

Closed
Jag96 opened this issue Jul 21, 2021 · 8 comments
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@Jag96
Copy link
Contributor

Jag96 commented Jul 21, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!

Upwork link: https://www.upwork.com/jobs/~017a88221b02e85314

New Feature

Master Issue
Doc Section

2021-06-04_18-18-39

Solution:

  1. Refactor the <EnvironmentBadge> component to just be called Badge
  2. Add a BadgeText prop to the MenuItem component
  3. Add a Badge component to MenuItem here.
  4. If the BadgeText prop exists, show the Badge component
  5. When rendering the settings page add a badgeText prop with a value equal to the ONYX.USER_WALLET.balance

View all open jobs on Upwork

@Jag96 Jag96 added External Added to denote the issue can be worked on by a contributor Engineering Daily KSv2 labels Jul 21, 2021
@Jag96 Jag96 self-assigned this Jul 21, 2021
@Jag96 Jag96 added the Exported label Jul 21, 2021
@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 21, 2021
@parasharrajat
Copy link
Member

parasharrajat commented Jul 22, 2021

This is Straightforward.

  1. I will update the MenuItem Component to Show an optional Badge near the arrow based on the prop badgeText.
  2. We will get the balance from the ONYX.USER_WALLET.balance.
  3. 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.

onPress={item.action}

4. We will show the formatted balance in the component with currency Sign.
Number(props.userWallet.balance).toFixed(2);

#Question:

  1. 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,
    }),
    ```

@haseeb-islam
Copy link

  • Yes Firstly I will create a badge view in Side Menu
  • Then I will check if we have value in “ONYX.USER_WALLET.balance” if yes then show it if not then simply hide the view
  • I will show balance in a formatted way. Like

function currencyFormat(num) {
return '$' + num.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}

OutPut will be = $2,665.00

@Jag96
Copy link
Contributor Author

Jag96 commented 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.

@Jag96 Jag96 added Weekly KSv2 and removed Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Jul 23, 2021
@arpitdeveloper
Copy link

  1. I will create a Badge in MenuItem component near by right arrow
  2. We will get the user current wallet balance(from CurrentWalletBalance.js)
  3. Print the user current wallet balance in created badge with currency and formate

@stitesExpensify
Copy link
Contributor

Hmm @kevinksullivan Is the wallet balance always in USD? Or should we localize it?

@kevinksullivan
Copy link
Contributor

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)

@parasharrajat
Copy link
Member

Great @kevinksullivan. that's what I assumed initially. PR is ready for review now.

@Jag96 Jag96 added the Reviewing Has a PR in review label Jul 28, 2021
@Jag96 Jag96 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 Jul 28, 2021
@Jag96
Copy link
Contributor Author

Jag96 commented Aug 4, 2021

Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants