-
Notifications
You must be signed in to change notification settings - Fork 384
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
[Experiment] USD balance for AccountBalance #5533
base: kien/pay-convert-endpoints
Are you sure you want to change the base?
Conversation
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
packages/thirdweb/src/react/web/ui/prebuilt/Account/balance.tsx
Outdated
Show resolved
Hide resolved
size-limit report 📦
|
1bf3114
to
c2329af
Compare
Don't forget a changeset but lgtm |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## kien/pay-convert-endpoints #5533 +/- ##
==============================================================
- Coverage 46.30% 46.16% -0.15%
==============================================================
Files 1082 1085 +3
Lines 58690 58871 +181
Branches 3954 3949 -5
==============================================================
+ Hits 27179 27180 +1
- Misses 30828 31007 +179
- Partials 683 684 +1
*This pull request uses carry forward flags. Click here to find out more.
|
dcd6b94
to
07afcee
Compare
c2329af
to
4b66fbd
Compare
fiatBalance: fiatData?.result, | ||
fiatSymbol: fiatData?.result | ||
? new Intl.NumberFormat("en", { | ||
style: "currency", | ||
currency: showFiatValue, | ||
minimumFractionDigits: 0, | ||
maximumFractionDigits: 0, | ||
}) | ||
.formatToParts(0) | ||
.find((p) => p.type === "currency")?.value || | ||
showFiatValue.toUpperCase() |
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.
Simplify currency symbol formatting by using a simple mapping object instead of Intl.NumberFormat. Could replace with: const currencySymbols = { USD: '$' }; const fiatSymbol = currencySymbols[showFiatValue] || showFiatValue.toUpperCase();
Spotted by Graphite Reviewer (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
4b66fbd
to
5b02ff0
Compare
CNCT-2494
PR-Codex overview
This PR focuses on enhancing the
AccountBalance
component by introducing new formatting functions for displaying balances, adding support for fiat values, and updating the props to accommodate these changes.Detailed summary
AccountBalanceFormatParams
type for balance formatting.formatFn
prop to accept an object instead of a number.formatAccountBalanceForButton
andformatAccountBalanceForModal
functions.showFiatValue
prop to display fiat currency.getWalletBalance
call to include fiat conversion.AccountBalance
to handle new formats.