Skip to content
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

Merged
merged 9 commits into from
Oct 17, 2023
Merged

Conversation

deepti-imx
Copy link
Contributor

@deepti-imx deepti-imx commented Oct 17, 2023

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:

  • Prefix your PR title with feat: , fix: , chore: , docs:, or refactor:.

@deepti-imx deepti-imx marked this pull request as ready for review October 17, 2023 04:27
@deepti-imx deepti-imx requested a review from a team as a code owner October 17, 2023 04:27
Comment on lines +19 to +24
const tokenSymbol = token.symbol.toLocaleLowerCase() === 'timx'
? IMX_TOKEN_SYMBOL
: token.symbol;
const gasFeeTokenConversion = conversions.get(
tokenSymbol.toLocaleLowerCase(),
);
Copy link
Contributor Author

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

Copy link
Contributor

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}
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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}
Copy link
Contributor Author

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

Copy link
Contributor

@sharonsheah sharonsheah left a 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 😄

@deepti-imx deepti-imx self-assigned this Oct 17, 2023
@deepti-imx deepti-imx enabled auto-merge (squash) October 17, 2023 05:38
@deepti-imx deepti-imx merged commit 8fcd150 into main Oct 17, 2023
6 checks passed
@deepti-imx deepti-imx deleted the wt-1798 branch October 17, 2023 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants