-
Notifications
You must be signed in to change notification settings - Fork 100
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(earn): Update earn deposit entry point bottom sheet #6350
Conversation
const showSwap = !canSwapDeposit && (hasTokensOnSameNetwork || hasTokensOnOtherNetworks) | ||
const showAdd = canAdd && !hasDepositToken | ||
const showAddMore = | ||
canAdd && hasDepositToken && !(hasTokensOnSameNetwork && hasTokensOnOtherNetworks) |
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 is for this case, where add isn't shown if a user can deposit and also has same AND differnet chain tokens.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6350 +/- ##
========================================
Coverage 88.92% 88.93%
========================================
Files 735 735
Lines 31364 31402 +38
Branches 5515 5833 +318
========================================
+ Hits 27892 27928 +36
+ Misses 3427 3276 -151
- Partials 45 198 +153
... and 66 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
/> | ||
)} | ||
{(canSwapDeposit || hasDepositToken) && | ||
(showCrossChainSwap || showSwap || showAdd || showAddMore) && ( |
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.
Should only show the message if something will show up beneath it
}) | ||
}) | ||
|
||
it('show bottom sheet correctly when Deposit button is tapped and depositTokenId does not have balance, can same and cross chain swap', () => { |
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.
All these tests moved to BeforeDepositBottomSheet.test.tsx
canAdd && hasDepositToken && !(hasTokensOnSameNetwork && hasTokensOnOtherNetworks) | ||
const showTransfer = | ||
(!hasDepositToken && !hasTokensOnSameNetwork && !hasTokensOnOtherNetworks) || | ||
(!canAdd && !(hasDepositToken && hasTokensOnSameNetwork && hasTokensOnOtherNetworks)) |
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.
Show transfer instead of add if the token is:
- Not a cash-in token
- Not this case (has deposit token, same chain and different chain tokens)
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.
👨🍳
Description
Bottom sheet always shows when tapping deposit, options match designs
Test plan
Unit tests updated / added
Manual tests (ignore + by deposit, it has been changed to the coins, see image at very bottom for coins icon)
Coins icon for deposit:
Show transfer if deposit token is not cash-in (except for case where deposit, swap&deposit and cross-chain swap is shown):
Related issues
Backwards compatibility
Yes
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: