From 7c3a2e5835dd8a6c8f80d758997d580fb7a41449 Mon Sep 17 00:00:00 2001 From: itaven Date: Tue, 20 Aug 2024 18:37:54 +0300 Subject: [PATCH 1/2] feat: change wrap success banner --- consts/matomo-click-events.ts | 6 +++++ .../hooks/use-tx-modal-stages-stake.tsx | 4 +--- .../wrap/hooks/use-tx-modal-stages-wrap.tsx | 23 +++++++++++++++++-- shared/banners/vaults-banner-info/const.ts | 2 ++ 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 shared/banners/vaults-banner-info/const.ts diff --git a/consts/matomo-click-events.ts b/consts/matomo-click-events.ts index 076cb60c3..b0e1f0b7c 100644 --- a/consts/matomo-click-events.ts +++ b/consts/matomo-click-events.ts @@ -18,6 +18,7 @@ export const enum MATOMO_CLICK_EVENTS_TYPES { obolBannerProceed = 'obolBannerProceed', obolBannerDVVLink = 'obolBannerDVVLink', exploreAllStrategiesAfterStake = 'exploreAllStrategiesAfterStake', + exploreAllStrategiesAfterWrap = 'exploreAllStrategiesAfterWrap', // FAQ faqSafeWorkWithLidoAudits = 'faqSafeWorkWithLidoAudits', faqLidoEthAprEthLandingPage = 'faqLidoEthAprEthLandingPage', @@ -147,6 +148,11 @@ export const MATOMO_CLICK_EVENTS: Record< 'Push "Explore all strategies" after staking', 'eth_widget_explore_all_strategies_after_staking', ], + [MATOMO_CLICK_EVENTS_TYPES.exploreAllStrategiesAfterWrap]: [ + 'Ethereum_Staking_Widget', + 'Push "Explore all strategies" after wrap', + 'eth_widget_explore_all_strategies_after_wraping', + ], // FAQ [MATOMO_CLICK_EVENTS_TYPES.faqSafeWorkWithLidoAudits]: [ 'Ethereum_Staking_Widget', diff --git a/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx b/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx index 8b7eeafc9..b3c9b18d2 100644 --- a/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx +++ b/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx @@ -12,9 +12,7 @@ import { TxStageOperationSucceedBalanceShown } from 'shared/transaction-modal/tx import type { BigNumber } from 'ethers'; import { trackEvent } from '@lidofinance/analytics-matomo'; import { MATOMO_CLICK_EVENTS } from 'consts/matomo-click-events'; - -const LINK_EXPLORE_STRATEGIES = - 'https://lido.fi/?pk_vid=6c467e14095d5ea11723712888b1fe5f#defi-strategies'; +import { LINK_EXPLORE_STRATEGIES } from '../../../../shared/banners/vaults-banner-info/const'; const STAGE_OPERATION_ARGS = { token: 'ETH', diff --git a/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx b/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx index c942d33c8..7a5156eeb 100644 --- a/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx +++ b/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx @@ -4,13 +4,17 @@ import { } from 'shared/transaction-modal/hooks/use-transaction-modal-stage'; import { getGeneralTransactionModalStages } from 'shared/transaction-modal/hooks/get-general-transaction-modal-stages'; -import { VaultsBannerStrategies } from 'shared/banners/vaults-banner-strategies'; import { TxStageSignOperationAmount } from 'shared/transaction-modal/tx-stages-composed/tx-stage-amount-operation'; import { TxStageOperationSucceedBalanceShown } from 'shared/transaction-modal/tx-stages-composed/tx-stage-operation-succeed-balance-shown'; import { getTokenDisplayName } from 'utils/getTokenDisplayName'; import type { BigNumber } from 'ethers'; import type { TokensWrappable } from 'features/wsteth/shared/types'; +import { VaultsBannerInfo } from '../../../../shared/banners/vaults-banner-info'; +import { Button, Link } from '@lidofinance/lido-ui'; +import { trackEvent } from '@lidofinance/analytics-matomo'; +import { MATOMO_CLICK_EVENTS } from '../../../../consts/matomo-click-events'; +import { LINK_EXPLORE_STRATEGIES } from '../../../../shared/banners/vaults-banner-info/const'; const STAGE_APPROVE_ARGS = { willReceiveToken: 'wstETH', @@ -83,7 +87,22 @@ const getTxModalStagesWrap = (transitStage: TransactionModalTransitStage) => ({ balance={balance} balanceToken={'wstETH'} operationText={'Wrapping'} - footer={} + footer={ + <> + +
+ + trackEvent(...MATOMO_CLICK_EVENTS.exploreAllStrategiesAfterWrap) + } + > + + + + } />, { isClosableOnLedger: true, diff --git a/shared/banners/vaults-banner-info/const.ts b/shared/banners/vaults-banner-info/const.ts new file mode 100644 index 000000000..23bf77f87 --- /dev/null +++ b/shared/banners/vaults-banner-info/const.ts @@ -0,0 +1,2 @@ +export const LINK_EXPLORE_STRATEGIES = + 'https://lido.fi/?pk_vid=6c467e14095d5ea11723712888b1fe5f#defi-strategies'; From 09dfbab5fca6c1c0fbed28e83204bdd26aa41cdf Mon Sep 17 00:00:00 2001 From: DiRaiks Date: Tue, 20 Aug 2024 18:57:58 +0300 Subject: [PATCH 2/2] fix: code style. landing link --- .../stake-form/hooks/use-tx-modal-stages-stake.tsx | 2 +- .../wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx | 12 +++++++----- shared/banners/vaults-banner-info/const.ts | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx b/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx index b3c9b18d2..81ed26b40 100644 --- a/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx +++ b/features/stake/stake-form/hooks/use-tx-modal-stages-stake.tsx @@ -12,7 +12,7 @@ import { TxStageOperationSucceedBalanceShown } from 'shared/transaction-modal/tx import type { BigNumber } from 'ethers'; import { trackEvent } from '@lidofinance/analytics-matomo'; import { MATOMO_CLICK_EVENTS } from 'consts/matomo-click-events'; -import { LINK_EXPLORE_STRATEGIES } from '../../../../shared/banners/vaults-banner-info/const'; +import { LINK_EXPLORE_STRATEGIES } from 'shared/banners/vaults-banner-info/const'; const STAGE_OPERATION_ARGS = { token: 'ETH', diff --git a/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx b/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx index 7a5156eeb..94517dfd0 100644 --- a/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx +++ b/features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx @@ -1,3 +1,6 @@ +import { Button, Link } from '@lidofinance/lido-ui'; +import { trackEvent } from '@lidofinance/analytics-matomo'; + import { TransactionModalTransitStage, useTransactionModalStage, @@ -6,15 +9,14 @@ import { getGeneralTransactionModalStages } from 'shared/transaction-modal/hooks import { TxStageSignOperationAmount } from 'shared/transaction-modal/tx-stages-composed/tx-stage-amount-operation'; import { TxStageOperationSucceedBalanceShown } from 'shared/transaction-modal/tx-stages-composed/tx-stage-operation-succeed-balance-shown'; +import { LINK_EXPLORE_STRATEGIES } from 'shared/banners/vaults-banner-info/const'; import { getTokenDisplayName } from 'utils/getTokenDisplayName'; import type { BigNumber } from 'ethers'; import type { TokensWrappable } from 'features/wsteth/shared/types'; -import { VaultsBannerInfo } from '../../../../shared/banners/vaults-banner-info'; -import { Button, Link } from '@lidofinance/lido-ui'; -import { trackEvent } from '@lidofinance/analytics-matomo'; -import { MATOMO_CLICK_EVENTS } from '../../../../consts/matomo-click-events'; -import { LINK_EXPLORE_STRATEGIES } from '../../../../shared/banners/vaults-banner-info/const'; +import { VaultsBannerInfo } from 'shared/banners/vaults-banner-info'; + +import { MATOMO_CLICK_EVENTS } from 'consts/matomo-click-events'; const STAGE_APPROVE_ARGS = { willReceiveToken: 'wstETH', diff --git a/shared/banners/vaults-banner-info/const.ts b/shared/banners/vaults-banner-info/const.ts index 23bf77f87..90e7c7247 100644 --- a/shared/banners/vaults-banner-info/const.ts +++ b/shared/banners/vaults-banner-info/const.ts @@ -1,2 +1 @@ -export const LINK_EXPLORE_STRATEGIES = - 'https://lido.fi/?pk_vid=6c467e14095d5ea11723712888b1fe5f#defi-strategies'; +export const LINK_EXPLORE_STRATEGIES = 'https://lido.fi/#defi-strategies';