From fea0fef5ab5f5b059b456dbf5a0be8db012ca78a Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:58:32 +0200 Subject: [PATCH] feat: savers display consolidate step for UTXOs only (#7673) --- .../Deposit/ThorchainSaversDeposit.tsx | 30 +++++++++++-------- .../Withdraw/ThorchainSaversWithdraw.tsx | 30 +++++++++++-------- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/ThorchainSaversDeposit.tsx b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/ThorchainSaversDeposit.tsx index f2429c98850..593813fbbbb 100644 --- a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/ThorchainSaversDeposit.tsx +++ b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/ThorchainSaversDeposit.tsx @@ -2,6 +2,7 @@ import { Center } from '@chakra-ui/react' import type { AccountId } from '@shapeshiftoss/caip' import { thorchainAssetId, toAssetId } from '@shapeshiftoss/caip' import type { Asset } from '@shapeshiftoss/types' +import { isUtxoChainId } from '@shapeshiftoss/utils' import { useQuery } from '@tanstack/react-query' import { DefiModalContent } from 'features/defi/components/DefiModal/DefiModalContent' import { DefiModalHeader } from 'features/defi/components/DefiModal/DefiModalHeader' @@ -163,18 +164,22 @@ export const ThorchainSaversDeposit: React.FC = ({ /> ), }, - [DefiStep.Sweep]: { - label: translate('modals.send.consolidate.consolidateFunds'), - component: ({ onNext }) => ( - - ), - }, + ...(isUtxoChainId(chainId) + ? { + [DefiStep.Sweep]: { + label: translate('modals.send.consolidate.consolidateFunds'), + component: ({ onNext }) => ( + + ), + }, + } + : {}), [DefiStep.Approve]: { label: translate('defi.steps.approve.title'), component: ownProps => , @@ -192,6 +197,7 @@ export const ThorchainSaversDeposit: React.FC = ({ }, [ translate, underlyingAsset?.symbol, + chainId, accountId, fromAddress, handleAccountIdChange, diff --git a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/ThorchainSaversWithdraw.tsx b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/ThorchainSaversWithdraw.tsx index eff781849b0..f98573d3bb9 100644 --- a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/ThorchainSaversWithdraw.tsx +++ b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/ThorchainSaversWithdraw.tsx @@ -1,6 +1,7 @@ import { Center } from '@chakra-ui/react' import type { AccountId } from '@shapeshiftoss/caip' import { thorchainAssetId, toAssetId } from '@shapeshiftoss/caip' +import { isUtxoChainId } from '@shapeshiftoss/utils' import { useQuery } from '@tanstack/react-query' import { DefiModalContent } from 'features/defi/components/DefiModal/DefiModalContent' import { DefiModalHeader } from 'features/defi/components/DefiModal/DefiModalHeader' @@ -148,18 +149,22 @@ export const ThorchainSaversWithdraw: React.FC = ({ accountId }) ), }, - [DefiStep.Sweep]: { - label: translate('modals.send.consolidate.consolidateFunds'), - component: ({ onNext }) => ( - - ), - }, + ...(isUtxoChainId(chainId) + ? { + [DefiStep.Sweep]: { + label: translate('modals.send.consolidate.consolidateFunds'), + component: ({ onNext }) => ( + + ), + }, + } + : {}), [DefiStep.Confirm]: { label: translate('defi.steps.confirm.title'), component: ownProps => , @@ -174,6 +179,7 @@ export const ThorchainSaversWithdraw: React.FC = ({ accountId }) accountId, asset.symbol, assetId, + chainId, fromAddress, makeHandleSweepBack, makeHandleSweepSeen,