fix: uniswapx review modal success display (#7097)

* fix: update swapConfirmed logic

* fix: success icon display
This commit is contained in:
cartcrom 2023-08-08 13:15:32 -04:00 committed by GitHub
parent 684258dc17
commit bd573724b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

@ -77,6 +77,7 @@ function Loader() {
} }
const Success = styled(AnimatedEntranceConfirmationIcon)` const Success = styled(AnimatedEntranceConfirmationIcon)`
position: relative;
margin-bottom: 10px; margin-bottom: 10px;
` `

@ -265,13 +265,10 @@ export function PendingModalContent({
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const swapStatus = useSwapTransactionStatus(swapResult) const swapStatus = useSwapTransactionStatus(swapResult)
const order = useOrder(swapResult?.type === TradeFillType.UniswapX ? swapResult.response.orderHash : '')
const classicSwapConfirmed = swapStatus === TransactionStatus.Confirmed const swapConfirmed = swapStatus === TransactionStatus.Confirmed || order?.status === UniswapXOrderStatus.FILLED
const wrapConfirmed = useIsTransactionConfirmed(wrapTxHash) const wrapConfirmed = useIsTransactionConfirmed(wrapTxHash)
// TODO(UniswapX): Support UniswapX status here too
const uniswapXSwapConfirmed = Boolean(swapResult)
const swapConfirmed = swapResult?.type === TradeFillType.Classic ? classicSwapConfirmed : uniswapXSwapConfirmed
const swapPending = swapResult !== undefined && !swapConfirmed const swapPending = swapResult !== undefined && !swapConfirmed
const wrapPending = wrapTxHash != undefined && !wrapConfirmed const wrapPending = wrapTxHash != undefined && !wrapConfirmed
@ -288,8 +285,6 @@ export function PendingModalContent({
chainId, chainId,
}) })
const order = useOrder(swapResult?.type === TradeFillType.UniswapX ? swapResult.response.orderHash : '')
const currentStepContainerRef = useRef<HTMLDivElement>(null) const currentStepContainerRef = useRef<HTMLDivElement>(null)
useUnmountingAnimation(currentStepContainerRef, () => AnimationType.EXITING) useUnmountingAnimation(currentStepContainerRef, () => AnimationType.EXITING)