@imtbl/checkout-widgets 2.24.8 → 2.24.9-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{AddTokensWidget-BQfrLKCo.js → AddTokensWidget-CIR8BF_I.js} +24 -297
- package/dist/browser/{BridgeWidget-6KlgTXwZ.js → BridgeWidget-C5Uljhhx.js} +13 -294
- package/dist/browser/{CommerceWidget-CcCuv661.js → CommerceWidget-CeBBYCbK.js} +17 -47
- package/dist/browser/{FeesBreakdown-DvoQJlP-.js → FeesBreakdown-BU4haotD.js} +1 -1
- package/dist/browser/{OnRampWidget-DaL34PiA.js → OnRampWidget-Ccvb3QkT.js} +5 -80
- package/dist/browser/{SaleWidget-D-IBBRTL.js → SaleWidget-CPARFlzv.js} +61 -219
- package/dist/browser/{SpendingCapHero-Z5NIcrWw.js → SpendingCapHero-B-0YYZho.js} +1 -1
- package/dist/browser/{SwapWidget-C4B2Answ.js → SwapWidget-ujE6uX-N.js} +12 -206
- package/dist/browser/{TokenImage-DucOedrZ.js → TokenImage-BeUf_Ulv.js} +1 -1
- package/dist/browser/{TopUpView-BIvdNYib.js → TopUpView-GMv3360Q.js} +3 -54
- package/dist/browser/{WalletApproveHero-ge2JSOYk.js → WalletApproveHero-BJi7ufqM.js} +4 -12
- package/dist/browser/{WalletWidget-hiUotMuQ.js → WalletWidget-BABrqsfd.js} +4 -96
- package/dist/browser/{index-2esq4Cem.js → index-CcxHW36j.js} +1275 -9717
- package/dist/browser/{index-DWNAmu0n.js → index-Cp1w6map.js} +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/{useInterval-1gu4cbu3.js → useInterval-DbCsm_gG.js} +1 -1
- package/dist/types/components/FormComponents/SelectForm/SelectForm.d.ts +1 -5
- package/dist/types/components/FormComponents/SelectInput/SelectInput.d.ts +1 -5
- package/dist/types/components/Transak/TransakIframe.d.ts +0 -1
- package/dist/types/components/Transak/useTransakEvents.d.ts +0 -4
- package/dist/types/components/WalletDrawer/ConnectWalletDrawer.d.ts +1 -2
- package/dist/types/lib/squid/hooks/useExecute.d.ts +1 -2
- package/dist/types/views/top-up/TopUpView.d.ts +1 -5
- package/dist/types/widgets/add-tokens/hooks/useError.d.ts +1 -1
- package/dist/types/widgets/purchase/components/PurchaseConnectWalletDrawer.d.ts +1 -3
- package/dist/types/widgets/sale/hooks/useSaleEvents.d.ts +5 -31
- package/dist/types/widgets/swap/components/Fees.d.ts +1 -1
- package/package.json +7 -9
- package/src/components/ConnectLoader/ConnectLoader.tsx +0 -16
- package/src/components/FormComponents/SelectForm/SelectForm.tsx +2 -18
- package/src/components/FormComponents/SelectInput/SelectInput.tsx +1 -12
- package/src/components/RouteOptionsDrawer/RouteOptionsDrawer.tsx +2 -26
- package/src/components/Transactions/ChangeWallet.tsx +1 -12
- package/src/components/Transactions/ClaimWithdrawalInProgress.tsx +0 -11
- package/src/components/Transactions/NoTransactions.tsx +0 -10
- package/src/components/Transactions/TransactionItemWithdrawPending.tsx +1 -13
- package/src/components/Transactions/Transactions.tsx +2 -28
- package/src/components/Transak/TransakIframe.tsx +0 -6
- package/src/components/Transak/useTransakEvents.ts +1 -70
- package/src/components/WalletDrawer/ConnectWalletDrawer.tsx +2 -35
- package/src/components/WalletDrawer/PayWithWalletDrawer.tsx +0 -1
- package/src/context/view-context/test-components/ViewContextTestComponent.tsx +14 -15
- package/src/lib/squid/hooks/useExecute.ts +5 -18
- package/src/views/top-up/TopUpView.tsx +5 -56
- package/src/widgets/add-tokens/AddTokensRoot.tsx +28 -29
- package/src/widgets/add-tokens/AddTokensWidget.tsx +2 -17
- package/src/widgets/add-tokens/components/TokenDrawerMenu.tsx +2 -18
- package/src/widgets/add-tokens/hooks/useError.tsx +1 -18
- package/src/widgets/add-tokens/hooks/useErrorHandler.ts +2 -12
- package/src/widgets/add-tokens/views/AddTokens.tsx +8 -154
- package/src/widgets/add-tokens/views/Review.tsx +6 -94
- package/src/widgets/bridge/BridgeWidget.tsx +0 -35
- package/src/widgets/bridge/BridgeWidgetRoot.tsx +17 -18
- package/src/widgets/bridge/components/BridgeForm.tsx +0 -20
- package/src/widgets/bridge/components/BridgeReviewSummary.tsx +1 -49
- package/src/widgets/bridge/components/WalletAndNetworkSelector.tsx +3 -122
- package/src/widgets/bridge/views/ApproveTransaction.tsx +1 -15
- package/src/widgets/bridge/views/Bridge.tsx +1 -16
- package/src/widgets/bridge/views/BridgeReview.tsx +1 -12
- package/src/widgets/bridge/views/ClaimWithdrawal.tsx +0 -11
- package/src/widgets/bridge/views/MoveInProgress.tsx +0 -24
- package/src/widgets/bridge/views/WalletNetworkSelectionView.tsx +1 -12
- package/src/widgets/connect/ConnectWidget.tsx +2 -18
- package/src/widgets/connect/ConnectWidgetRoot.tsx +15 -16
- package/src/widgets/connect/components/WalletList.tsx +6 -55
- package/src/widgets/connect/views/ConnectWallet.tsx +1 -12
- package/src/widgets/connect/views/ReadyToConnect.tsx +2 -29
- package/src/widgets/connect/views/SwitchNetworkEth.tsx +3 -22
- package/src/widgets/connect/views/SwitchNetworkZkEVM.tsx +0 -18
- package/src/widgets/immutable-commerce/CommerceWidgetRoot.tsx +17 -19
- package/src/widgets/on-ramp/OnRampWidget.tsx +0 -2
- package/src/widgets/on-ramp/OnRampWidgetRoot.tsx +23 -24
- package/src/widgets/on-ramp/views/OnRampMain.tsx +1 -91
- package/src/widgets/purchase/PurchaseWidgetRoot.tsx +22 -23
- package/src/widgets/purchase/components/PurchaseConnectWalletDrawer.tsx +2 -34
- package/src/widgets/purchase/components/PurchaseDeliverToWalletDrawer.tsx +0 -1
- package/src/widgets/purchase/components/PurchasePayWithWalletDrawer.tsx +0 -2
- package/src/widgets/purchase/components/PurchaseRouteOptionsDrawer/RouteOptionsDrawer.tsx +1 -30
- package/src/widgets/purchase/components/WithCard.tsx +0 -4
- package/src/widgets/purchase/views/Purchase.tsx +1 -2
- package/src/widgets/sale/SaleWidget.tsx +0 -2
- package/src/widgets/sale/SaleWidgetRoot.tsx +32 -33
- package/src/widgets/sale/components/OrderReview.tsx +2 -29
- package/src/widgets/sale/components/WithCard.tsx +0 -2
- package/src/widgets/sale/hooks/useSaleEvents.ts +3 -185
- package/src/widgets/sale/views/OrderSummary.tsx +2 -15
- package/src/widgets/sale/views/PayWithCard.tsx +4 -46
- package/src/widgets/sale/views/PayWithCoins.tsx +4 -9
- package/src/widgets/sale/views/PaymentMethods.tsx +3 -6
- package/src/widgets/sale/views/SaleErrorView.tsx +1 -1
- package/src/widgets/swap/SwapWidget.tsx +0 -24
- package/src/widgets/swap/SwapWidgetRoot.tsx +29 -30
- package/src/widgets/swap/components/Fees.tsx +1 -1
- package/src/widgets/swap/components/SwapForm.tsx +2 -140
- package/src/widgets/swap/views/ApproveERC20Onboarding.tsx +1 -36
- package/src/widgets/swap/views/SwapCoins.tsx +0 -17
- package/src/widgets/swap/views/SwapInProgress.tsx +0 -14
- package/src/widgets/transfer/TransferForm.tsx +3 -25
- package/src/widgets/transfer/TransferWidget.tsx +1 -23
- package/src/widgets/wallet/WalletWidgetRoot.tsx +24 -25
- package/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx +1 -50
- package/src/widgets/wallet/components/NetworkMenu/NetworkMenu.tsx +0 -13
- package/src/widgets/wallet/components/WalletAddress/WalletAddress.tsx +0 -13
- package/src/widgets/wallet/views/CoinInfo.tsx +1 -12
- package/src/widgets/wallet/views/Settings.tsx +1 -15
- package/src/widgets/wallet/views/WalletBalances.tsx +0 -24
- package/tsconfig.json +0 -1
- package/dist/browser/auto-track-C-H4NHVE.js +0 -105
- package/dist/browser/index-CcQ-5rAF.js +0 -446
- package/dist/browser/index-CvpdSuud.js +0 -5634
- package/dist/browser/index-D3m5uC9C.js +0 -60
- package/dist/browser/index-DJEaNohG.js +0 -65
- package/dist/browser/index-DPz4F2rf.js +0 -27
- package/dist/browser/index-DQZhPkHy.js +0 -65
- package/dist/browser/index.umd-brf0Qwxh.js +0 -32
- package/dist/browser/is-plan-event-enabled-mXX0dwl-.js +0 -17
- package/dist/types/context/analytics-provider/CustomAnalyticsProvider.d.ts +0 -7
- package/dist/types/context/analytics-provider/SegmentAnalyticsProvider.d.ts +0 -42
- package/dist/types/context/analytics-provider/SetupAnalytics.d.ts +0 -7
- package/dist/types/lib/analytics/identifyUser.d.ts +0 -8
- package/dist/types/lib/analytics/identifyUser.test.d.ts +0 -1
- package/src/context/analytics-provider/CustomAnalyticsProvider.tsx +0 -22
- package/src/context/analytics-provider/SegmentAnalyticsProvider.ts +0 -41
- package/src/context/analytics-provider/SetupAnalytics.tsx +0 -35
- package/src/lib/analytics/identifyUser.test.ts +0 -44
- package/src/lib/analytics/identifyUser.ts +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T as TokenImage } from './TokenImage-
|
|
3
|
-
import { u as useInterval } from './useInterval-
|
|
1
|
+
import { ac as _objectWithoutProperties, N as useTheme, dC as getStartingSize, dD as DEFAULT_BUTTON_SIZE, aj as merge, r as reactExports, ap as flattenChildren, q as jsx, dt as isChildSubcomponent, as as SmartClone, t as Box, dE as getResponsiveSx, dF as BUTTON_SIZES, dG as setDefaultSxBackgroundColor, a_ as ButtCon, dr as ClassNames, v as Button, ab as _defineProperty, l as TokenFilterTypes, u as useTranslation, aP as ViewContext, s as jsxs, y as Body, V as ViewActions, X as ConnectLoaderContext, E as EventTargetContext, bG as r, aK as MenuItem, D as tokenValueFormat, K as orchestrationEvents, I as IMTBLWidgetEvents, i as formatZeroAmount, aG as isPassportProvider, dH as ZERO_BALANCE_STRING, aW as isNativeToken, dI as sendNetworkSwitchEvent, cq as CheckoutErrorType, a3 as SharedViews, dJ as NetworkFilterTypes, dK as sortNetworksCompareFn, ct as getChainImage, cB as retry, di as DEFAULT_BALANCE_RETRY_POLICY, dL as sortTokensByAmount, aX as getTokenImageByAddress, j as calculateCryptoToFiat, z as CryptoFiatContext, $ as CryptoFiatActions, G as HeaderNavigation, cH as ButtonNavigationStyles, dM as sendWalletWidgetCloseEvent, bZ as FooterLogo, x as SimpleLayout, cG as WalletProviderName, cF as getWalletProviderNameByProvider, dA as isDualVariantIcon, c2 as abbreviateWalletAddress, H as Heading, ay as Drawer, cv as useWalletConnect, dN as sendDisconnectWalletEvent, cy as isWalletConnectProvider, cT as heroBackGroundStyles, cU as heroImageStyles, dy as heroImageBottomAlign, cV as SimpleTextBody, dO as FAQS_LINK, L as Link, bC as viewReducer, bD as initialViewState, U as CryptoFiatProvider, _ as LoadingView, a4 as ErrorView } from './index-CcxHW36j.js';
|
|
2
|
+
import { T as TokenImage } from './TokenImage-BeUf_Ulv.js';
|
|
3
|
+
import { u as useInterval } from './useInterval-DbCsm_gG.js';
|
|
4
4
|
|
|
5
5
|
var horizontalMenuSxProps = {
|
|
6
6
|
justifyContent: "stretch",
|
|
@@ -321,7 +321,6 @@ const ShowMenuItem = (show) => ({
|
|
|
321
321
|
|
|
322
322
|
function BalanceItem({ balanceInfo, theme, bridgeToL2OnClick, }) {
|
|
323
323
|
const { connectLoaderState } = reactExports.useContext(ConnectLoaderContext);
|
|
324
|
-
const { track } = useAnalytics();
|
|
325
324
|
const { checkout, provider } = connectLoaderState;
|
|
326
325
|
const fiatAmount = `≈ USD $${formatZeroAmount(balanceInfo.fiatAmount)}`;
|
|
327
326
|
const { walletState } = reactExports.useContext(WalletContext);
|
|
@@ -388,16 +387,6 @@ function BalanceItem({ balanceInfo, theme, bridgeToL2OnClick, }) {
|
|
|
388
387
|
swapAllowedTokens,
|
|
389
388
|
]);
|
|
390
389
|
const handleAddTokenClick = () => {
|
|
391
|
-
track({
|
|
392
|
-
userJourney: UserJourney.WALLET,
|
|
393
|
-
screen: 'WalletBalances',
|
|
394
|
-
control: 'AddTokens',
|
|
395
|
-
controlType: 'Button',
|
|
396
|
-
extras: {
|
|
397
|
-
tokenSymbol: balanceInfo.symbol,
|
|
398
|
-
tokenAddress: balanceInfo.address,
|
|
399
|
-
},
|
|
400
|
-
});
|
|
401
390
|
if (isAddTokensEnabled) {
|
|
402
391
|
orchestrationEvents.sendRequestAddTokensEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {
|
|
403
392
|
toAmount: '',
|
|
@@ -410,44 +399,13 @@ function BalanceItem({ balanceInfo, theme, bridgeToL2OnClick, }) {
|
|
|
410
399
|
amount: '',
|
|
411
400
|
});
|
|
412
401
|
};
|
|
413
|
-
return (jsxs(MenuItem, { testId: `balance-item-${balanceInfo.symbol}`, emphasized: true, children: [jsx(MenuItem.FramedImage, { use: (jsx(TokenImage, { theme: theme, src: balanceInfo.icon, name: balanceInfo.symbol, environment: checkout?.config.environment ?? r.PRODUCTION })), circularFrame: true }), jsx(MenuItem.Label, { children: balanceInfo.symbol }), jsx(MenuItem.Caption, { children: balanceInfo.description }), jsx(MenuItem.PriceDisplay, { testId: `balance-item-${balanceInfo.symbol}`, price: tokenValueFormat(balanceInfo.balance), fiatAmount: fiatAmount }), (isOnRampEnabled || isSwapEnabled || isBridgeEnabled || isAddTokensEnabled) && (jsxs(MenuItem.OverflowPopoverMenu, { size: "small", testId: "token-menu", onClick: () => {
|
|
414
|
-
track({
|
|
415
|
-
userJourney: UserJourney.WALLET,
|
|
416
|
-
screen: 'WalletBalances',
|
|
417
|
-
control: 'BalanceItem',
|
|
418
|
-
controlType: 'Button',
|
|
419
|
-
extras: {
|
|
420
|
-
tokenSymbol: balanceInfo.symbol,
|
|
421
|
-
tokenAddress: balanceInfo.address,
|
|
422
|
-
},
|
|
423
|
-
});
|
|
424
|
-
}, children: [jsxs(MenuItem, { testId: "balance-item-add-option", sx: ShowMenuItem(showAddTokenMenuItem), onClick: handleAddTokenClick, children: [jsx(MenuItem.Icon, { icon: "Add" }), jsx(MenuItem.Label, { children: `Add ${balanceInfo.symbol}` })] }), jsxs(MenuItem, { testId: "balance-item-swap-option", sx: ShowMenuItem(isSwapEnabled), onClick: () => {
|
|
425
|
-
track({
|
|
426
|
-
userJourney: UserJourney.WALLET,
|
|
427
|
-
screen: 'WalletBalances',
|
|
428
|
-
control: 'SwapTokens',
|
|
429
|
-
controlType: 'Button',
|
|
430
|
-
extras: {
|
|
431
|
-
tokenSymbol: balanceInfo.symbol,
|
|
432
|
-
tokenAddress: balanceInfo.address,
|
|
433
|
-
},
|
|
434
|
-
});
|
|
402
|
+
return (jsxs(MenuItem, { testId: `balance-item-${balanceInfo.symbol}`, emphasized: true, children: [jsx(MenuItem.FramedImage, { use: (jsx(TokenImage, { theme: theme, src: balanceInfo.icon, name: balanceInfo.symbol, environment: checkout?.config.environment ?? r.PRODUCTION })), circularFrame: true }), jsx(MenuItem.Label, { children: balanceInfo.symbol }), jsx(MenuItem.Caption, { children: balanceInfo.description }), jsx(MenuItem.PriceDisplay, { testId: `balance-item-${balanceInfo.symbol}`, price: tokenValueFormat(balanceInfo.balance), fiatAmount: fiatAmount }), (isOnRampEnabled || isSwapEnabled || isBridgeEnabled || isAddTokensEnabled) && (jsxs(MenuItem.OverflowPopoverMenu, { size: "small", testId: "token-menu", children: [jsxs(MenuItem, { testId: "balance-item-add-option", sx: ShowMenuItem(showAddTokenMenuItem), onClick: handleAddTokenClick, children: [jsx(MenuItem.Icon, { icon: "Add" }), jsx(MenuItem.Label, { children: `Add ${balanceInfo.symbol}` })] }), jsxs(MenuItem, { testId: "balance-item-swap-option", sx: ShowMenuItem(isSwapEnabled), onClick: () => {
|
|
435
403
|
orchestrationEvents.sendRequestSwapEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {
|
|
436
404
|
fromTokenAddress: balanceInfo.address ?? '',
|
|
437
405
|
toTokenAddress: '',
|
|
438
406
|
amount: '',
|
|
439
407
|
});
|
|
440
408
|
}, children: [jsx(MenuItem.Icon, { icon: "Exchange" }), jsx(MenuItem.Label, { children: `Swap ${balanceInfo.symbol}` })] }), jsxs(MenuItem, { testId: "balance-item-move-option", sx: ShowMenuItem(isBridgeEnabled), onClick: () => {
|
|
441
|
-
track({
|
|
442
|
-
userJourney: UserJourney.WALLET,
|
|
443
|
-
screen: 'WalletBalances',
|
|
444
|
-
control: 'MoveTokens',
|
|
445
|
-
controlType: 'Button',
|
|
446
|
-
extras: {
|
|
447
|
-
tokenSymbol: balanceInfo.symbol,
|
|
448
|
-
tokenAddress: balanceInfo.address,
|
|
449
|
-
},
|
|
450
|
-
});
|
|
451
409
|
bridgeToL2OnClick(balanceInfo.address);
|
|
452
410
|
}, children: [jsx(MenuItem.Icon, { icon: "Minting" }), jsx(MenuItem.Label, { children: `Move ${balanceInfo.symbol}` })] })] }))] }));
|
|
453
411
|
}
|
|
@@ -507,19 +465,9 @@ function NetworkMenu() {
|
|
|
507
465
|
const { walletState, walletDispatch } = reactExports.useContext(WalletContext);
|
|
508
466
|
const { network } = walletState;
|
|
509
467
|
const [allowedNetworks, setNetworks] = reactExports.useState([]);
|
|
510
|
-
const { track } = useAnalytics();
|
|
511
468
|
const switchNetwork = reactExports.useCallback(async (chainId) => {
|
|
512
469
|
if (!checkout || !provider || !network || Number(network.chainId) === chainId)
|
|
513
470
|
return;
|
|
514
|
-
track({
|
|
515
|
-
userJourney: UserJourney.WALLET,
|
|
516
|
-
screen: 'WalletBalances',
|
|
517
|
-
control: 'SwitchNetwork',
|
|
518
|
-
controlType: 'Button',
|
|
519
|
-
extras: {
|
|
520
|
-
chainId,
|
|
521
|
-
},
|
|
522
|
-
});
|
|
523
471
|
try {
|
|
524
472
|
const switchNetworkResult = await checkout.switchNetwork({
|
|
525
473
|
provider,
|
|
@@ -650,18 +598,11 @@ function WalletBalances({ balancesLoading, theme, showNetworkMenu, }) {
|
|
|
650
598
|
const { conversions } = cryptoFiatState;
|
|
651
599
|
const isPassport = isPassportProvider(provider);
|
|
652
600
|
const enableNetworkMenu = !isPassport && showNetworkMenu;
|
|
653
|
-
const { track, page } = useAnalytics();
|
|
654
601
|
const balanceInfos = reactExports.useMemo(() => {
|
|
655
602
|
if (!network?.chainId)
|
|
656
603
|
return [];
|
|
657
604
|
return mapTokenBalancesWithConversions(Number(network.chainId), tokenBalances, conversions);
|
|
658
605
|
}, [tokenBalances, conversions, network?.chainId]);
|
|
659
|
-
reactExports.useEffect(() => {
|
|
660
|
-
page({
|
|
661
|
-
userJourney: UserJourney.WALLET,
|
|
662
|
-
screen: 'WalletBalances',
|
|
663
|
-
});
|
|
664
|
-
}, []);
|
|
665
606
|
reactExports.useEffect(() => {
|
|
666
607
|
(async () => {
|
|
667
608
|
if (!checkout)
|
|
@@ -697,12 +638,6 @@ function WalletBalances({ balancesLoading, theme, showNetworkMenu, }) {
|
|
|
697
638
|
|| supportedTopUps?.isOnRampEnabled));
|
|
698
639
|
}, [checkout, network, supportedTopUps]);
|
|
699
640
|
const handleAddCoinsClick = () => {
|
|
700
|
-
track({
|
|
701
|
-
userJourney: UserJourney.WALLET,
|
|
702
|
-
screen: 'WalletBalances',
|
|
703
|
-
control: 'AddCoins',
|
|
704
|
-
controlType: 'Button',
|
|
705
|
-
});
|
|
706
641
|
orchestrationEvents.sendRequestAddTokensEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {});
|
|
707
642
|
};
|
|
708
643
|
const handleBridgeToL2OnClick = (address) => {
|
|
@@ -712,12 +647,6 @@ function WalletBalances({ balancesLoading, theme, showNetworkMenu, }) {
|
|
|
712
647
|
});
|
|
713
648
|
};
|
|
714
649
|
return (jsx(SimpleLayout, { testId: "wallet-balances", header: (jsx(HeaderNavigation, { title: t('views.WALLET_BALANCES.header.title'), rightActions: (jsx(ButtCon, { icon: "SettingsCog", sx: ButtonNavigationStyles(), iconVariant: "bold", onClick: () => {
|
|
715
|
-
track({
|
|
716
|
-
userJourney: UserJourney.WALLET,
|
|
717
|
-
screen: 'WalletBalances',
|
|
718
|
-
control: 'Settings',
|
|
719
|
-
controlType: 'Button',
|
|
720
|
-
});
|
|
721
650
|
viewDispatch({
|
|
722
651
|
payload: {
|
|
723
652
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -747,7 +676,6 @@ function WalletAddress({ provider, showL1Warning, setShowL1Warning, }) {
|
|
|
747
676
|
const [walletAddress, setWalletAddress] = reactExports.useState('');
|
|
748
677
|
const [isCopied, setIsCopied] = reactExports.useState(false);
|
|
749
678
|
const { t } = useTranslation();
|
|
750
|
-
const { track } = useAnalytics();
|
|
751
679
|
const ctaIcon = reactExports.useMemo(() => {
|
|
752
680
|
if (isPassportProvider(provider) && !showL1Warning) {
|
|
753
681
|
return 'ShowPassword';
|
|
@@ -764,12 +692,6 @@ function WalletAddress({ provider, showL1Warning, setShowL1Warning, }) {
|
|
|
764
692
|
}, [provider, walletAddress]);
|
|
765
693
|
const handleIconClick = async () => {
|
|
766
694
|
if (walletAddress && ctaIcon === 'CopyText') {
|
|
767
|
-
track({
|
|
768
|
-
userJourney: UserJourney.WALLET,
|
|
769
|
-
screen: 'Settings',
|
|
770
|
-
control: 'CopyWalletAddress',
|
|
771
|
-
controlType: 'Button',
|
|
772
|
-
});
|
|
773
695
|
navigator.clipboard.writeText(walletAddress);
|
|
774
696
|
setIsCopied(true);
|
|
775
697
|
setTimeout(() => setIsCopied(false), 1000);
|
|
@@ -833,13 +755,6 @@ function Settings({ showDisconnectButton }) {
|
|
|
833
755
|
const { provider } = connectLoaderState;
|
|
834
756
|
const { eventTargetState: { eventTarget }, } = reactExports.useContext(EventTargetContext);
|
|
835
757
|
const { ethereumProvider } = useWalletConnect();
|
|
836
|
-
const { page } = useAnalytics();
|
|
837
|
-
reactExports.useEffect(() => {
|
|
838
|
-
page({
|
|
839
|
-
userJourney: UserJourney.WALLET,
|
|
840
|
-
screen: 'Settings',
|
|
841
|
-
});
|
|
842
|
-
}, []);
|
|
843
758
|
// disconnect all Wallet Connect pairings and disconnect the provider
|
|
844
759
|
// so that restoreSession doesn't pick up the previous sessions
|
|
845
760
|
const handleWCDisconnect = async () => {
|
|
@@ -890,13 +805,6 @@ function CoinInfo() {
|
|
|
890
805
|
const { t } = useTranslation();
|
|
891
806
|
const { connectLoaderState: { provider } } = reactExports.useContext(ConnectLoaderContext);
|
|
892
807
|
const isPassport = isPassportProvider(provider);
|
|
893
|
-
const { page } = useAnalytics();
|
|
894
|
-
reactExports.useEffect(() => {
|
|
895
|
-
page({
|
|
896
|
-
userJourney: UserJourney.WALLET,
|
|
897
|
-
screen: 'CoinInfo',
|
|
898
|
-
});
|
|
899
|
-
}, []);
|
|
900
808
|
return (jsxs(SimpleLayout, { testId: "coin-info", header: jsx(HeaderNavigation, { showBack: true, transparent: true }), footer: jsx(FooterLogo, {}), heroContent: jsx(IMXCoinsHero, {}), floatHeader: true, children: [!isPassport && (jsx(SimpleTextBody, { heading: t('views.COIN_INFO.metamask.heading'), children: t('views.COIN_INFO.metamask.body') })), isPassport && (jsxs(SimpleTextBody, { heading: t('views.COIN_INFO.passport.heading'), children: [t('views.COIN_INFO.passport.body1'), jsx(Link, { onClick: () => window.open(FAQS_LINK), children: t('views.COIN_INFO.passport.linkText') }), t('views.COIN_INFO.passport.body2')] }))] }));
|
|
901
809
|
}
|
|
902
810
|
|