-
Notifications
You must be signed in to change notification settings - Fork 13
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
[WT-1798] Skip fetching fees estimates on top-up view #1001
Conversation
const tokenSymbol = token.symbol.toLocaleLowerCase() === 'timx' | ||
? IMX_TOKEN_SYMBOL | ||
: token.symbol; | ||
const gasFeeTokenConversion = conversions.get( | ||
tokenSymbol.toLocaleLowerCase(), | ||
); |
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.
Added this check because swap fees is always -.--
in dev/sandbox env due to symbol being tIMX
instead of IMX
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 we instead go token.address === IMX_ADDRESS_ZKEVM
instead of token.symbol.toLocaleLowerCase() === 'timx'
since symbol isnt unique identifier and the address should still be the 0x..1010 one
@@ -33,7 +32,7 @@ export function TopUpMenuItem({ | |||
</MenuItem.Label> | |||
<MenuItem.IntentIcon /> | |||
<MenuItem.Caption testId={`menu-item-caption-${testId}`}> | |||
{isDisabled ? disabledCaption : caption} | |||
{caption} |
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.
Removed the prop disabledCaption
.
This is now handled in Top-up view to decide what text to show as caption
@@ -4,19 +4,25 @@ import { | |||
import { mount } from 'cypress/react18'; | |||
import { BiomeCombinedProviders } from '@biom3/react'; | |||
import { IMTBLWidgetEvents } from '@imtbl/checkout-widgets'; | |||
import { Checkout, GasEstimateType, WalletProviderName } from '@imtbl/checkout-sdk'; | |||
import { |
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.
Mostly linting on this file.
Added a new test case on line:412
icon={element.icon as 'Wallet' | 'Coins' | 'Minting'} | ||
heading={element.textConfig.heading} | ||
caption={element.textConfig.caption} | ||
caption={!element.isAvailable ? element.textConfig.disabledCaption : element.textConfig.caption} |
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.
Deciding what caption to show and removed prop disabledCaption
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.
Nice work!! looks good to me 😄
Summary
When a feature is not enabled or is not available (geo-blocked), then skip the fees estimate fetching for that feature.
Screen.Recording.2023-10-17.at.14.01.42.mov
Made an improvement where the fees are displayed as and when they are fetched:
Screen.Recording.2023-10-17.at.15.13.35.mov
Why the changes
Things worth calling out
Before submitting the PR, please consider the following:
feat:
,fix:
,chore:
,docs:
, orrefactor:
.