@@ -31,6 +31,7 @@ import {
31
31
TOKEN_AMOUNT_MIN_DECIMALS ,
32
32
USD_VALUE_MAX_DECIMALS ,
33
33
USD_VALUE_MIN_DECIMALS ,
34
+ VALUE_LENGTH_THRESHOLD ,
34
35
} from '../../constants/routing' ;
35
36
import {
36
37
FooterAlert ,
@@ -57,11 +58,11 @@ import { getTotalFeeInUsd, getUsdFeeOfStep } from '../../utils/swap';
57
58
58
59
import {
59
60
AllRoutesButton ,
61
+ AmountText ,
60
62
BasicInfoOutput ,
61
63
basicInfoStyles ,
62
64
ContainerInfoOutput ,
63
65
Content ,
64
- FrameIcon ,
65
66
HorizontalSeparator ,
66
67
Line ,
67
68
QuoteContainer ,
@@ -70,6 +71,7 @@ import {
70
71
summaryHeaderStyles ,
71
72
summaryStyles ,
72
73
TagContainer ,
74
+ TokenNameText ,
73
75
} from './Quote.styles' ;
74
76
import { QuoteCostDetails } from './QuoteCostDetails' ;
75
77
import { QuoteSummary } from './QuoteSummary' ;
@@ -97,11 +99,6 @@ export function Quote(props: QuoteProps) {
97
99
const userSlippage = customSlippage || slippage ;
98
100
const [ expanded , setExpanded ] = useState ( props . expanded ) ;
99
101
const quoteRef = useRef < HTMLButtonElement | null > ( null ) ;
100
- const roundedInput = numberToString (
101
- input . value ,
102
- TOKEN_AMOUNT_MIN_DECIMALS ,
103
- TOKEN_AMOUNT_MAX_DECIMALS
104
- ) ;
105
102
const roundedOutput = numberToString (
106
103
output . value ,
107
104
TOKEN_AMOUNT_MIN_DECIMALS ,
@@ -422,24 +419,40 @@ export function Quote(props: QuoteProps) {
422
419
</ div >
423
420
{ type === 'basic' && (
424
421
< div className = { basicInfoStyles ( ) } >
425
- < FrameIcon >
426
- < InfoIcon size = { 12 } color = "gray" />
427
- </ FrameIcon >
428
422
< ContainerInfoOutput >
429
- < BasicInfoOutput size = "small" variant = "body" >
430
- { `${ roundedInput } ${ steps [ 0 ] . from . token . displayName } = ` }
423
+ < BasicInfoOutput >
424
+ < AmountText size = "small" variant = "body" >
425
+ { input . value }
426
+ </ AmountText >
427
+ { input . value . length > VALUE_LENGTH_THRESHOLD && (
428
+ < NumericTooltip
429
+ content = { input . value }
430
+ container = { container }
431
+ open = { ! input . value ? false : undefined } >
432
+ < InfoIcon size = { 12 } color = "gray" />
433
+ </ NumericTooltip >
434
+ ) }
435
+ < TokenNameText size = "small" variant = "body" >
436
+ { steps [ 0 ] . from . token . displayName }
437
+ </ TokenNameText >
438
+ < Typography size = "small" variant = "body" >
439
+ =
440
+ </ Typography >
441
+ < AmountText size = "small" variant = "body" >
442
+ { output . value }
443
+ </ AmountText >
444
+ { output . value . length > VALUE_LENGTH_THRESHOLD && (
445
+ < NumericTooltip
446
+ content = { output . value }
447
+ container = { container }
448
+ open = { ! output . value ? false : undefined } >
449
+ < InfoIcon size = { 12 } color = "gray" />
450
+ </ NumericTooltip >
451
+ ) }
452
+ < TokenNameText size = "small" variant = "body" >
453
+ { steps [ steps . length - 1 ] . to . token . displayName }
454
+ </ TokenNameText >
431
455
</ BasicInfoOutput >
432
- < NumericTooltip
433
- content = { output . value }
434
- container = { container }
435
- open = { ! output . value ? false : undefined } >
436
- < BasicInfoOutput size = "small" variant = "body" >
437
-
438
- { `${ roundedOutput } ${
439
- steps [ steps . length - 1 ] . to . token . displayName
440
- } `}
441
- </ BasicInfoOutput >
442
- </ NumericTooltip >
443
456
</ ContainerInfoOutput >
444
457
< NumericTooltip content = { output . usdValue } container = { container } >
445
458
< Divider size = { 2 } direction = "horizontal" />
0 commit comments