Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feat_usdt_reset_er…
Browse files Browse the repository at this point in the history
…rwhere
  • Loading branch information
gomesalexandre committed Sep 2, 2024
2 parents 72568d7 + fea0fef commit 1a906b6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Steps } from 'components/DeFi/components/Steps'
import { Sweep } from 'components/Sweep'
import { useBrowserRouter } from 'hooks/useBrowserRouter/useBrowserRouter'
import { useWallet } from 'hooks/useWallet/useWallet'
import { isUtxoChainId } from 'lib/utils/utxo'
import { getThorchainSaversPosition } from 'state/slices/opportunitiesSlice/resolvers/thorchainsavers/utils'
import type { StakingId } from 'state/slices/opportunitiesSlice/types'
import { serializeUserStakingId, toOpportunityId } from 'state/slices/opportunitiesSlice/utils'
Expand Down Expand Up @@ -163,18 +164,22 @@ export const ThorchainSaversDeposit: React.FC<YearnDepositProps> = ({
/>
),
},
[DefiStep.Sweep]: {
label: translate('modals.send.consolidate.consolidateFunds'),
component: ({ onNext }) => (
<Sweep
accountId={accountId}
fromAddress={fromAddress ?? null}
assetId={assetId}
onBack={makeHandleSweepBack(onNext)}
onSweepSeen={makeHandleSweepSeen(onNext)}
/>
),
},
...(isUtxoChainId(chainId)
? {
[DefiStep.Sweep]: {
label: translate('modals.send.consolidate.consolidateFunds'),
component: ({ onNext }) => (
<Sweep
accountId={accountId}
fromAddress={fromAddress ?? null}
assetId={assetId}
onBack={makeHandleSweepBack(onNext)}
onSweepSeen={makeHandleSweepSeen(onNext)}
/>
),
},
}
: {}),
...(assetId === usdtAssetId
? {
[DefiStep.AllowanceReset]: {
Expand All @@ -201,10 +206,11 @@ export const ThorchainSaversDeposit: React.FC<YearnDepositProps> = ({
}, [
translate,
underlyingAsset?.symbol,
chainId,
assetId,
accountId,
fromAddress,
handleAccountIdChange,
assetId,
makeHandleSweepBack,
makeHandleSweepSeen,
])
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -148,18 +149,22 @@ export const ThorchainSaversWithdraw: React.FC<WithdrawProps> = ({ accountId })
<Withdraw {...ownProps} accountId={accountId} fromAddress={fromAddress} />
),
},
[DefiStep.Sweep]: {
label: translate('modals.send.consolidate.consolidateFunds'),
component: ({ onNext }) => (
<Sweep
accountId={accountId}
fromAddress={fromAddress ?? null}
assetId={assetId}
onBack={makeHandleSweepBack(onNext)}
onSweepSeen={makeHandleSweepSeen(onNext)}
/>
),
},
...(isUtxoChainId(chainId)
? {
[DefiStep.Sweep]: {
label: translate('modals.send.consolidate.consolidateFunds'),
component: ({ onNext }) => (
<Sweep
accountId={accountId}
fromAddress={fromAddress ?? null}
assetId={assetId}
onBack={makeHandleSweepBack(onNext)}
onSweepSeen={makeHandleSweepSeen(onNext)}
/>
),
},
}
: {}),
[DefiStep.Confirm]: {
label: translate('defi.steps.confirm.title'),
component: ownProps => <Confirm {...ownProps} accountId={accountId} />,
Expand All @@ -174,6 +179,7 @@ export const ThorchainSaversWithdraw: React.FC<WithdrawProps> = ({ accountId })
accountId,
asset.symbol,
assetId,
chainId,
fromAddress,
makeHandleSweepBack,
makeHandleSweepSeen,
Expand Down

0 comments on commit 1a906b6

Please sign in to comment.