|
|
@ -8,6 +8,7 @@ import { toPrecisionWithoutTrailingZeros } from '../../../helpers/utils/util' |
|
|
|
import Tooltip from '../../../components/ui/tooltip' |
|
|
|
import Tooltip from '../../../components/ui/tooltip' |
|
|
|
import SunCheckIcon from '../../../components/ui/icon/sun-check-icon.component' |
|
|
|
import SunCheckIcon from '../../../components/ui/icon/sun-check-icon.component' |
|
|
|
import ExchangeRateDisplay from '../exchange-rate-display' |
|
|
|
import ExchangeRateDisplay from '../exchange-rate-display' |
|
|
|
|
|
|
|
import { formatSwapsValueForDisplay } from '../swaps.util' |
|
|
|
import QuoteBackdrop from './quote-backdrop' |
|
|
|
import QuoteBackdrop from './quote-backdrop' |
|
|
|
|
|
|
|
|
|
|
|
function getFontSizes (fontSizeScore) { |
|
|
|
function getFontSizes (fontSizeScore) { |
|
|
@ -60,10 +61,7 @@ export default function MainQuoteSummary ({ |
|
|
|
const sourceAmount = toPrecisionWithoutTrailingZeros(calcTokenAmount(sourceValue, sourceDecimals).toString(10), 12) |
|
|
|
const sourceAmount = toPrecisionWithoutTrailingZeros(calcTokenAmount(sourceValue, sourceDecimals).toString(10), 12) |
|
|
|
const destinationAmount = calcTokenAmount(destinationValue, destinationDecimals) |
|
|
|
const destinationAmount = calcTokenAmount(destinationValue, destinationDecimals) |
|
|
|
|
|
|
|
|
|
|
|
let amountToDisplay = toPrecisionWithoutTrailingZeros(destinationAmount, 12) |
|
|
|
const amountToDisplay = formatSwapsValueForDisplay(destinationAmount) |
|
|
|
if (amountToDisplay.match(/e[+-]/u)) { |
|
|
|
|
|
|
|
amountToDisplay = (new BigNumber(amountToDisplay)).toFixed() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const fontSizeScore = getFontSizeScore(amountToDisplay, destinationSymbol) |
|
|
|
const fontSizeScore = getFontSizeScore(amountToDisplay, destinationSymbol) |
|
|
|
const [numberFontSize, symbolFontSize] = getFontSizes(fontSizeScore) |
|
|
|
const [numberFontSize, symbolFontSize] = getFontSizes(fontSizeScore) |
|
|
|
const lineHeight = getLineHeight(fontSizeScore) |
|
|
|
const lineHeight = getLineHeight(fontSizeScore) |
|
|
|