hover text nit

This commit is contained in:
Moody Salem 2021-05-12 17:12:16 -05:00
parent e08e597655
commit 0e9f23ed56
No known key found for this signature in database
GPG Key ID: 8CB5CD10385138DB
2 changed files with 6 additions and 6 deletions

@ -25,7 +25,7 @@ export function FiatValue({
return (
<TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}>
{fiatValue ? '~' : ''}$
<HoverInlineText text={fiatValue ? Number(fiatValue?.toSignificant(6)).toLocaleString('en') : '-'} />{' '}
<HoverInlineText text={fiatValue ? fiatValue?.toSignificant(6, { groupSeparator: ',' }) : '-'} />{' '}
{priceImpact ? (
<span style={{ color: priceImpactColor }}> ({priceImpact.multiply(-1).toSignificant(3)}%)</span>
) : null}

@ -2,8 +2,8 @@ import Tooltip from 'components/Tooltip'
import React, { useState } from 'react'
import styled from 'styled-components'
const TextWrapper = styled.span<{ margin: boolean; link: boolean; fontSize?: string; adjustSize?: boolean }>`
position: relative;
const TextWrapper = styled.span<{ margin: boolean; link?: boolean; fontSize?: string; adjustSize?: boolean }>`
cursor: auto;
margin-left: ${({ margin }) => margin && '4px'};
color: ${({ theme, link }) => (link ? theme.blue1 : theme.text1)};
font-size: ${({ fontSize }) => fontSize ?? 'inherit'};
@ -32,7 +32,7 @@ const HoverInlineText = ({
const [showHover, setShowHover] = useState(false)
if (!text) {
return <span></span>
return <span />
}
if (text.length > maxCharacters) {
@ -43,7 +43,7 @@ const HoverInlineText = ({
onMouseLeave={() => setShowHover(false)}
margin={margin}
adjustSize={adjustSize}
link={!!link}
link={link}
fontSize={fontSize}
{...rest}
>
@ -54,7 +54,7 @@ const HoverInlineText = ({
}
return (
<TextWrapper margin={margin} adjustSize={adjustSize} link={!!link} fontSize={fontSize} {...rest}>
<TextWrapper margin={margin} adjustSize={adjustSize} link={link} fontSize={fontSize} {...rest}>
{text}
</TextWrapper>
)