-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(frontend): Hide Send button for zero balance #3250
feat(frontend): Hide Send button for zero balance #3250
Conversation
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 code LGTM, thanks!
Re. the transition - IMO, not event element should have it. In your particular case, having an animation for a middle button would probably look more like a layout shift. Therefore, I would proceed without it.
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.
which one you think makes more sense? Or even less width? |
Motivation
We want to hide the Send button in the Hero when the user has no tokens, and display a different message. That is ONLY for the main page, and not the transactions page.
Note that we are talking about token balance and not USD balance, since for some tokens we don't have an exchange rate.
Changes
balancesStore
.Actions
component to showSend
button in the main page ONLY when there are at least some non-zero-balance tokens.ExchangeBalance
to show a difference sentence if there are no tokens.Tests
For the derived, I decided to create a specific util and test that one. I think I covered all possible scenarios, but any input welcome.
For the results, here it is (no changes for users with non-zero balances):
Transition
I tried to add a fade transition for the Send button when suddenly some token arrives, however, it messes up the layout, and since the Button layout is quite nested, I am not sure how to tackle this.