@@ -14,11 +14,11 @@ import { amount, routes } from '@wormhole-foundation/sdk';
14
14
15
15
import config from 'config' ;
16
16
import TokenIcon from 'icons/TokenIcons' ;
17
- import { isEmptyObject , calculateUSDPrice } from 'utils' ;
18
- import { millisToMinutesAndSeconds } from 'utils/transferValidation' ;
17
+ import { isEmptyObject , calculateUSDPrice , millisToHumanString } from 'utils' ;
19
18
20
19
import type { RouteData } from 'config/routes' ;
21
20
import type { RootState } from 'store' ;
21
+ import { formatBalance } from 'store/transferInput' ;
22
22
23
23
const useStyles = makeStyles ( ) ( ( theme : any ) => ( {
24
24
container : {
@@ -144,7 +144,7 @@ const SingleRoute = (props: Props) => {
144
144
< CircularProgress size = { 14 } />
145
145
) : (
146
146
< Typography fontSize = { 14 } >
147
- { millisToMinutesAndSeconds ( quote ?. eta ?? 0 ) }
147
+ { quote ?. eta ? millisToHumanString ( quote . eta ) : 'N/A' }
148
148
</ Typography >
149
149
) }
150
150
</ >
@@ -263,15 +263,25 @@ const SingleRoute = (props: Props) => {
263
263
return quote ? amount . whole ( quote ?. destinationToken . amount ) : undefined ;
264
264
} , [ quote ] ) ;
265
265
266
+ const receiveAmountTrunc = useMemo ( ( ) => {
267
+ return quote && destChain
268
+ ? formatBalance (
269
+ destChain ,
270
+ destTokenConfig ,
271
+ quote . destinationToken . amount . amount ,
272
+ )
273
+ : undefined ;
274
+ } , [ quote ] ) ;
275
+
266
276
const routeCardHeader = useMemo ( ( ) => {
267
277
return typeof receiveAmount === 'undefined' ? (
268
278
< CircularProgress size = { 18 } />
269
279
) : (
270
280
< Typography >
271
- { receiveAmount } { destTokenConfig . symbol }
281
+ { receiveAmountTrunc } { destTokenConfig . symbol }
272
282
</ Typography >
273
283
) ;
274
- } , [ destToken , receiveAmount ] ) ;
284
+ } , [ destToken , receiveAmountTrunc ] ) ;
275
285
276
286
const routeCardSubHeader = useMemo ( ( ) => {
277
287
if ( typeof receiveAmount === 'undefined' ) {
0 commit comments