-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: label main and secondary balances #13462
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
d98d06f
to
7e60898
Compare
@@ -207,7 +207,7 @@ const StakingBalanceContent = ({ asset }: StakingBalanceProps) => { | |||
{hasEthToUnstake && !isLoadingPooledStakesData && ( | |||
<AssetElement | |||
asset={asset} | |||
mainBalance={stakedBalanceETH} | |||
secondaryBalance={stakedBalanceETH} | |||
balance={stakedBalanceFiat} |
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.
This component is owned by @MetaMask/metamask-staking and is currently displaying fiat balance as the primary and ETH balance as secondary without taking into account the primaryCurrency
setting.
Since this is a bug fix for another component, I didn't want to change the behaviour of this one, but it's probably worth checking what it should be.
Note that before this PR, balance
was the primary balance and mainBalance
was the secondary balance. This PR just renames mainBalance
as secondaryBalance
to correctly describe how it behaves.
7e60898
to
f4773c3
Compare
f4773c3
to
62f8e82
Compare
|
60166ba
to
2b5f232
Compare
|
2b5f232
to
887c004
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13462 +/- ##
==========================================
+ Coverage 61.84% 62.02% +0.17%
==========================================
Files 1977 1983 +6
Lines 43895 44010 +115
Branches 5933 5956 +23
==========================================
+ Hits 27146 27295 +149
+ Misses 14948 14921 -27
+ Partials 1801 1794 -7 ☔ View full report in Codecov by Sentry. |
|
887c004
to
0f1bae6
Compare
0f1bae6
to
88171b8
Compare
|
|
Description
It's been reported that setting the primary currency to "Native" was displaying fiat as the main currency and the native currency as secondary. The opposite would happen when setting the primary currency to "Fiat".
This was due to using the wrong nomenclature as the properties of the component responsible for that behaviour (
balance
was the primary balance andmainBalance
was the secondary balance).The chosen solution to fix nomenclature is leaving
balance
as the primary balance changing the name ofmainBalance
tosecondaryBalance
.This component is used in three different places:
The behaviour for the token list and balance have been fixed to work as the setting suggests. The staking balance has been left as it currently is pending confirmation of whether it needs to follow the same behaviour.
Related issues
Fixes: No open GitHub issue for the ticket
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist