@@ -9,20 +9,25 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
99import { LoadingSpinner } from '../../LoadingSpinner.js'
1010import { type Token } from '../../../../types/index.js'
1111import { faArrowRight } from '@fortawesome/free-solid-svg-icons/faArrowRight'
12+ import type { useQuote } from '@reservoir0x/relay-kit-hooks'
13+ import { formatDollar } from '../../../../utils/numbers.js'
1214
1315type SwapConfirmationStepProps = {
1416 fromToken ?: Token
1517 toToken ?: Token
18+ quote ?: ReturnType < typeof useQuote > [ 'data' ]
1619 fromAmountFormatted : string
1720 toAmountFormatted : string
1821}
1922
2023export const SwapConfirmationStep : FC < SwapConfirmationStepProps > = ( {
2124 fromToken,
2225 toToken,
26+ quote,
2327 fromAmountFormatted,
2428 toAmountFormatted
2529} ) => {
30+ const details = quote ?. details
2631 return (
2732 < >
2833 < Flex
@@ -41,20 +46,22 @@ export const SwapConfirmationStep: FC<SwapConfirmationStepProps> = ({
4146 width : '100%'
4247 } }
4348 >
44- < Text style = "subtitle2" color = "subtle" >
45- From
46- </ Text >
47-
48- < Flex align = "center" css = { { gap : '2' , cursor : 'pointer' } } >
49+ < Flex
50+ direction = "column"
51+ align = "start"
52+ css = { { gap : '1' , cursor : 'pointer' } }
53+ >
4954 < ChainTokenIcon
5055 chainId = { fromToken ?. chainId }
5156 tokenlogoURI = { fromToken ?. logoURI }
5257 css = { { height : 32 , width : 32 } }
5358 />
54-
55- < Text style = "subtitle1" ellipsify >
59+ < Text style = "h6" ellipsify >
5660 { fromAmountFormatted } { fromToken ?. symbol }
5761 </ Text >
62+ < Text style = "subtitle3" color = "subtle" >
63+ { formatDollar ( Number ( details ?. currencyIn ?. amountUsd ) ) }
64+ </ Text >
5865 </ Flex >
5966 </ Flex >
6067 < Text
@@ -77,18 +84,22 @@ export const SwapConfirmationStep: FC<SwapConfirmationStepProps> = ({
7784 width : '100%'
7885 } }
7986 >
80- < Text style = "subtitle2" color = "subtle" >
81- To
82- </ Text >
83- < Flex align = "center" css = { { gap : '2' , cursor : 'pointer' } } >
87+ < Flex
88+ direction = "column"
89+ align = "start"
90+ css = { { gap : '1' , cursor : 'pointer' } }
91+ >
8492 < ChainTokenIcon
8593 chainId = { toToken ?. chainId }
8694 tokenlogoURI = { toToken ?. logoURI }
8795 css = { { height : 32 , width : 32 } }
8896 />
89- < Text style = "subtitle1 " ellipsify >
97+ < Text style = "h6 " ellipsify >
9098 { toAmountFormatted } { toToken ?. symbol }
9199 </ Text >
100+ < Text style = "subtitle3" color = "subtle" >
101+ { formatDollar ( Number ( details ?. currencyOut ?. amountUsd ) ) }
102+ </ Text >
92103 </ Flex >
93104 </ Flex >
94105 </ Flex >
0 commit comments