File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/components/transactions/Switch Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,10 @@ export const BaseSwitchModalContent = ({
442
442
} )
443
443
: null ;
444
444
445
+ const receivingPercentage = ! switchRates
446
+ ? undefined
447
+ : ( Number ( switchRates ?. destUSD ) * ( 1 - safeSlippage ) ) / Number ( switchRates ?. srcUSD ) ;
448
+
445
449
// Component
446
450
return (
447
451
< >
@@ -626,6 +630,15 @@ export const BaseSwitchModalContent = ({
626
630
/>
627
631
{ txError && < ParaswapErrorDisplay txError = { txError } /> }
628
632
633
+ { receivingPercentage && receivingPercentage < 0.7 && (
634
+ < Warning severity = "warning" icon = { false } sx = { { mt : 2 , mb : 2 } } >
635
+ < Typography variant = "caption" >
636
+ Costs may be up to { 100 - Math . round ( receivingPercentage * 100 ) } % of the value
637
+ sent
638
+ </ Typography >
639
+ </ Warning >
640
+ ) }
641
+
629
642
< SwitchActions
630
643
isWrongNetwork = { isWrongNetwork . isWrongNetwork }
631
644
inputAmount = { debounceInputAmount }
You can’t perform that action at this time.
0 commit comments