diff --git a/packages/ui/src/components/common/TransactionModal/SwapModal.tsx b/packages/ui/src/components/common/TransactionModal/SwapModal.tsx index 2d39d005..ac2f8394 100644 --- a/packages/ui/src/components/common/TransactionModal/SwapModal.tsx +++ b/packages/ui/src/components/common/TransactionModal/SwapModal.tsx @@ -215,7 +215,8 @@ const InnerSwapModal: FC = ({ onOpenChange={onOpenChange} contentCss={{ overflow: 'hidden', - p: isReviewQuoteStep ? '4' : '5' + p: isReviewQuoteStep ? '4' : '5', + maxWidth: 400 }} showCloseButton={isReviewQuoteStep} > diff --git a/packages/ui/src/components/common/TransactionModal/steps/ErrorStep.tsx b/packages/ui/src/components/common/TransactionModal/steps/ErrorStep.tsx index 0aabe335..b6b62d12 100644 --- a/packages/ui/src/components/common/TransactionModal/steps/ErrorStep.tsx +++ b/packages/ui/src/components/common/TransactionModal/steps/ErrorStep.tsx @@ -5,6 +5,7 @@ import { Button, Flex, Pill, + Skeleton, Text } from '../../../primitives/index.js' import { motion } from 'framer-motion' @@ -22,7 +23,6 @@ import { faRotateRight } from '@fortawesome/free-solid-svg-icons/index.js' import type { useRequests } from '@reservoir0x/relay-kit-hooks' -import { isAPIError } from '@reservoir0x/relay-sdk' type ErrorStepProps = { error?: Error | null @@ -72,10 +72,7 @@ export const ErrorStep: FC = ({ fillTx?.chainId, relayClient?.chains ) - const mergedError = - error && (isAPIError(error) || isSolverStatusTimeout) - ? error - : new Error(errorMessage) + const mergedError = isRefund && errorMessage ? new Error(errorMessage) : error const refundDetails = transaction?.data?.refundCurrencyData const refundChain = transaction?.data?.refundCurrencyData?.currency?.chainId ? relayClient?.chains.find( @@ -132,95 +129,115 @@ export const ErrorStep: FC = ({ ) : ( )} + {depositTx || fillTx ? ( + <> + + + Deposit Tx + {depositTx ? ( + + {truncateAddress(depositTx.txHash)} + + + ) : ( + + Order has not been filled + + )} + + + + Fill Tx + {isRefund ? ( + + {' '} + Refunded + + ) : null} + - - - Deposit Tx - {depositTx ? ( - - {truncateAddress(depositTx.txHash)} - - - ) : ( - - Order has not been filled - - )} - - - - Fill Tx - {isRefund ? ( - - {' '} - Refunded - - ) : null} + {fillTx ? ( + + {truncateAddress(fillTx.txHash)} + + + ) : null} + + {!fillTx && !isSolverStatusTimeout ? ( + + Order has not been filled + + ) : null} + + {!fillTx && isSolverStatusTimeout ? : null} + - {fillTx ? ( - - {truncateAddress(fillTx.txHash)} - - - ) : ( - - Order has not been filled - - )} - - - - + + + + + + ) : ( - + )} ) }