Skip to content

Commit

Permalink
chore: remove TransactionConfirmationModal from ConfirmSwapModal
Browse files Browse the repository at this point in the history
Did not seem to be in needed as there's another instance called from within
ConfirmSwap modal.

Must test other use cases to be sure it still works as before
  • Loading branch information
alfetopito committed Jul 4, 2023
1 parent 5444db2 commit 4a45dea
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ import { useCallback } from 'react'
import { Percent } from '@uniswap/sdk-core'

import { ConfirmSwapModal } from 'legacy/components/swap/ConfirmSwapModal'
import { TransactionConfirmationModal } from 'legacy/components/TransactionConfirmationModal'
import { useCloseModals } from 'legacy/state/application/hooks'
import { useModalIsOpen } from 'legacy/state/application/hooks'
import { ApplicationModal } from 'legacy/state/application/reducer'
import { Field } from 'legacy/state/swap/actions'
import { useSwapActionHandlers } from 'legacy/state/swap/hooks'
import TradeGp from 'legacy/state/swap/TradeGp'

import { useSwapConfirmManager } from 'modules/swap/hooks/useSwapConfirmManager'
import { HandleSwapCallback } from 'modules/swap/pure/SwapButtons'
import { swapConfirmAtom } from 'modules/swap/state/swapConfirmAtom'
import { transactionConfirmAtom } from 'modules/swap/state/transactionConfirmAtom'

import { RateInfoParams } from 'common/pure/RateInfo'

Expand All @@ -30,19 +25,11 @@ export interface ConfirmSwapModalSetupProps {
}

export function ConfirmSwapModalSetup(props: ConfirmSwapModalSetupProps) {
const { trade, recipient, allowedSlippage, priceImpact, handleSwap, dismissNativeWrapModal, rateInfoParams } = props
const { trade, recipient, allowedSlippage, priceImpact, handleSwap, rateInfoParams } = props

const swapConfirmState = useAtomValue(swapConfirmAtom)
const { operationType, pendingText } = useAtomValue(transactionConfirmAtom)
const { acceptRateUpdates, closeSwapConfirm } = useSwapConfirmManager()
const { onUserInput } = useSwapActionHandlers()
const closeModals = useCloseModals()
const showTransactionConfirmationModal = useModalIsOpen(ApplicationModal.TRANSACTION_CONFIRMATION)

const onDismiss = useCallback(() => {
closeModals()
dismissNativeWrapModal()
}, [closeModals, dismissNativeWrapModal])

const handleAcceptChanges = useCallback(() => {
trade && acceptRateUpdates(trade)
Expand Down Expand Up @@ -70,14 +57,6 @@ export function ConfirmSwapModalSetup(props: ConfirmSwapModalSetupProps) {
onConfirm={handleSwap}
onDismiss={handleConfirmDismiss}
/>

<TransactionConfirmationModal
attemptingTxn={true}
isOpen={showTransactionConfirmationModal}
pendingText={pendingText}
onDismiss={onDismiss}
operationType={operationType}
/>
</>
)
}

0 comments on commit 4a45dea

Please sign in to comment.