diff --git a/.changeset/real-jokes-mate.md b/.changeset/real-jokes-mate.md new file mode 100644 index 00000000..baa35874 --- /dev/null +++ b/.changeset/real-jokes-mate.md @@ -0,0 +1,5 @@ +--- +'@reservoir0x/relay-kit-ui': patch +--- + +Update SwapConfirmationStep ui to fix overflow diff --git a/packages/ui/src/components/common/TransactionModal/SwapModal.tsx b/packages/ui/src/components/common/TransactionModal/SwapModal.tsx index abb0cea1..7af87510 100644 --- a/packages/ui/src/components/common/TransactionModal/SwapModal.tsx +++ b/packages/ui/src/components/common/TransactionModal/SwapModal.tsx @@ -285,6 +285,7 @@ const InnerSwapModal: FC = ({ toToken={toToken} fromAmountFormatted={fromAmountFormatted} toAmountFormatted={toAmountFormatted} + quote={quote} /> ) : null} {progressStep === TransactionProgressStep.Validating ? ( diff --git a/packages/ui/src/components/common/TransactionModal/steps/SwapConfirmationStep.tsx b/packages/ui/src/components/common/TransactionModal/steps/SwapConfirmationStep.tsx index 2b931aac..6dd35418 100644 --- a/packages/ui/src/components/common/TransactionModal/steps/SwapConfirmationStep.tsx +++ b/packages/ui/src/components/common/TransactionModal/steps/SwapConfirmationStep.tsx @@ -9,10 +9,13 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { LoadingSpinner } from '../../LoadingSpinner.js' import { type Token } from '../../../../types/index.js' import { faArrowRight } from '@fortawesome/free-solid-svg-icons/faArrowRight' +import type { useQuote } from '@reservoir0x/relay-kit-hooks' +import { formatDollar } from '../../../../utils/numbers.js' type SwapConfirmationStepProps = { fromToken?: Token toToken?: Token + quote?: ReturnType['data'] fromAmountFormatted: string toAmountFormatted: string } @@ -20,9 +23,11 @@ type SwapConfirmationStepProps = { export const SwapConfirmationStep: FC = ({ fromToken, toToken, + quote, fromAmountFormatted, toAmountFormatted }) => { + const details = quote?.details return ( <> = ({ width: '100%' }} > - - From - - - + - - + {fromAmountFormatted} {fromToken?.symbol} + + {formatDollar(Number(details?.currencyIn?.amountUsd))} + = ({ width: '100%' }} > - - To - - + - + {toAmountFormatted} {toToken?.symbol} + + {formatDollar(Number(details?.currencyOut?.amountUsd))} +