From 2aa32ef9f76f9955d18fc7b840c27dbe069579d7 Mon Sep 17 00:00:00 2001 From: Ixm 759 <759ixm@gmail.com> Date: Wed, 9 Jun 2021 14:31:55 -0500 Subject: [PATCH] fix: Estimate the value of low-denomination tokens --- src/components/CurrencyInputPanel/index.tsx | 4 +-- .../swap/EstimatedConvertDollar.tsx | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index 498a4b4c..e07c6591 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -3,7 +3,7 @@ import { Currency, Pair } from '@apeswapfinance/sdk' import { Button, ChevronDownIcon, Text } from '@apeswapfinance/uikit' import styled from 'styled-components' import { darken } from 'polished' -// import EstimatedConvertDollar from 'components/swap/EstimatedConvertDollar' +import EstimatedConvertDollar from 'components/swap/EstimatedConvertDollar' import { useCurrencyBalance } from '../../state/wallet/hooks' import CurrencySearchModal from '../SearchModal/CurrencySearchModal' import CurrencyLogo from '../CurrencyLogo' @@ -183,7 +183,7 @@ export default function CurrencyInputPanel({ - {/* */} + {!disableCurrencySelect && onCurrencySelect && ( { setTotalRate(total); }, [total]) + return trade ? totalRate : null; +} + +export default function EstimatedConvertDollar({ currency, typedValue = null }: { currency: any; typedValue: any }) { + const totalRate = CalculateRate(currency, typedValue); return ( ~ - {trade ? ${totalRate || 0} : '-'} + {totalRate ? ${totalRate || 0} : '-'} ) } +