fix: dont show USD price difference for wraps (#7610)

dont show stableconi price difference on wraps
This commit is contained in:
Tina 2023-11-17 17:46:16 -05:00 committed by GitHub
parent dd4b2dc764
commit 1ffaf723de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -355,13 +355,13 @@ export function Swap({
const preTaxFiatValueTradeOutput = useUSDPrice(trade?.outputAmount) const preTaxFiatValueTradeOutput = useUSDPrice(trade?.outputAmount)
const [stablecoinPriceImpact, preTaxStablecoinPriceImpact] = useMemo( const [stablecoinPriceImpact, preTaxStablecoinPriceImpact] = useMemo(
() => () =>
routeIsSyncing || !isClassicTrade(trade) routeIsSyncing || !isClassicTrade(trade) || showWrap
? [undefined, undefined] ? [undefined, undefined]
: [ : [
computeFiatValuePriceImpact(fiatValueTradeInput.data, fiatValueTradeOutput.data), computeFiatValuePriceImpact(fiatValueTradeInput.data, fiatValueTradeOutput.data),
computeFiatValuePriceImpact(fiatValueTradeInput.data, preTaxFiatValueTradeOutput.data), computeFiatValuePriceImpact(fiatValueTradeInput.data, preTaxFiatValueTradeOutput.data),
], ],
[fiatValueTradeInput, fiatValueTradeOutput, preTaxFiatValueTradeOutput, routeIsSyncing, trade] [fiatValueTradeInput, fiatValueTradeOutput, preTaxFiatValueTradeOutput, routeIsSyncing, trade, showWrap]
) )
const { onSwitchTokens, onCurrencySelection, onUserInput, onChangeRecipient } = useSwapActionHandlers(dispatch) const { onSwitchTokens, onCurrencySelection, onUserInput, onChangeRecipient } = useSwapActionHandlers(dispatch)