From bd573724b94a9cdd4ea338c1fcaf64c006d5ca36 Mon Sep 17 00:00:00 2001 From: cartcrom <39385577+cartcrom@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:15:32 -0400 Subject: [PATCH] fix: uniswapx review modal success display (#7097) * fix: update swapConfirmed logic * fix: success icon display --- .../MiniPortfolio/Activity/OffchainActivityModal.tsx | 1 + src/components/swap/PendingModalContent/index.tsx | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/AccountDrawer/MiniPortfolio/Activity/OffchainActivityModal.tsx b/src/components/AccountDrawer/MiniPortfolio/Activity/OffchainActivityModal.tsx index d518366777..64f3896daf 100644 --- a/src/components/AccountDrawer/MiniPortfolio/Activity/OffchainActivityModal.tsx +++ b/src/components/AccountDrawer/MiniPortfolio/Activity/OffchainActivityModal.tsx @@ -77,6 +77,7 @@ function Loader() { } const Success = styled(AnimatedEntranceConfirmationIcon)` + position: relative; margin-bottom: 10px; ` diff --git a/src/components/swap/PendingModalContent/index.tsx b/src/components/swap/PendingModalContent/index.tsx index 04abaaa4fc..577298f4d1 100644 --- a/src/components/swap/PendingModalContent/index.tsx +++ b/src/components/swap/PendingModalContent/index.tsx @@ -265,13 +265,10 @@ export function PendingModalContent({ const { chainId } = useWeb3React() 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) - // 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 wrapPending = wrapTxHash != undefined && !wrapConfirmed @@ -288,8 +285,6 @@ export function PendingModalContent({ chainId, }) - const order = useOrder(swapResult?.type === TradeFillType.UniswapX ? swapResult.response.orderHash : '') - const currentStepContainerRef = useRef(null) useUnmountingAnimation(currentStepContainerRef, () => AnimationType.EXITING)