Skip to content

Commit

Permalink
feat: change wrap success banner
Browse files Browse the repository at this point in the history
  • Loading branch information
itaven committed Aug 20, 2024
1 parent 80f59c5 commit 7c3a2e5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
6 changes: 6 additions & 0 deletions consts/matomo-click-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const enum MATOMO_CLICK_EVENTS_TYPES {
obolBannerProceed = 'obolBannerProceed',
obolBannerDVVLink = 'obolBannerDVVLink',
exploreAllStrategiesAfterStake = 'exploreAllStrategiesAfterStake',
exploreAllStrategiesAfterWrap = 'exploreAllStrategiesAfterWrap',
// FAQ
faqSafeWorkWithLidoAudits = 'faqSafeWorkWithLidoAudits',
faqLidoEthAprEthLandingPage = 'faqLidoEthAprEthLandingPage',
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
23 changes: 21 additions & 2 deletions features/wsteth/wrap/hooks/use-tx-modal-stages-wrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -83,7 +87,22 @@ const getTxModalStagesWrap = (transitStage: TransactionModalTransitStage) => ({
balance={balance}
balanceToken={'wstETH'}
operationText={'Wrapping'}
footer={<VaultsBannerStrategies />}
footer={
<>
<VaultsBannerInfo isTitleCompact showLearnMoreButton={false} />
<br />
<Link
href={LINK_EXPLORE_STRATEGIES}
onClick={() =>
trackEvent(...MATOMO_CLICK_EVENTS.exploreAllStrategiesAfterWrap)
}
>
<Button fullwidth size="sm">
Explore strategies
</Button>
</Link>
</>
}
/>,
{
isClosableOnLedger: true,
Expand Down
2 changes: 2 additions & 0 deletions shared/banners/vaults-banner-info/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const LINK_EXPLORE_STRATEGIES =
'https://lido.fi/?pk_vid=6c467e14095d5ea11723712888b1fe5f#defi-strategies';

0 comments on commit 7c3a2e5

Please sign in to comment.