Commit 3bb55c6b authored by eddie's avatar eddie Committed by GitHub

fix: hide price when no amount input (#7379)

* fix: hide price when no amount input

* fix: snapshots
parent 71212f7e
...@@ -323,6 +323,8 @@ export function Swap({ ...@@ -323,6 +323,8 @@ export function Swap({
[independentField, parsedAmount, showWrap, trade] [independentField, parsedAmount, showWrap, trade]
) )
const showFiatValueInput = Boolean(parsedAmounts[Field.INPUT])
const showFiatValueOutput = Boolean(parsedAmounts[Field.OUTPUT])
const getSingleUnitAmount = (currency?: Currency) => { const getSingleUnitAmount = (currency?: Currency) => {
if (!currency) return if (!currency) return
return CurrencyAmount.fromRawAmount(currency, JSBI.BigInt(10 ** currency.decimals)) return CurrencyAmount.fromRawAmount(currency, JSBI.BigInt(10 ** currency.decimals))
...@@ -641,7 +643,7 @@ export function Swap({ ...@@ -641,7 +643,7 @@ export function Swap({
currency={currencies[Field.INPUT] ?? null} currency={currencies[Field.INPUT] ?? null}
onUserInput={handleTypeInput} onUserInput={handleTypeInput}
onMax={handleMaxInput} onMax={handleMaxInput}
fiatValue={fiatValueInput} fiatValue={showFiatValueInput ? fiatValueInput : undefined}
onCurrencySelect={handleInputSelect} onCurrencySelect={handleInputSelect}
otherCurrency={currencies[Field.OUTPUT]} otherCurrency={currencies[Field.OUTPUT]}
showCommonBases showCommonBases
...@@ -682,7 +684,7 @@ export function Swap({ ...@@ -682,7 +684,7 @@ export function Swap({
label={<Trans>You receive</Trans>} label={<Trans>You receive</Trans>}
showMaxButton={false} showMaxButton={false}
hideBalance={false} hideBalance={false}
fiatValue={fiatValueOutput} fiatValue={showFiatValueOutput ? fiatValueOutput : undefined}
priceImpact={stablecoinPriceImpact} priceImpact={stablecoinPriceImpact}
currency={currencies[Field.OUTPUT] ?? null} currency={currencies[Field.OUTPUT] ?? null}
onCurrencySelect={handleOutputSelect} onCurrencySelect={handleOutputSelect}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment