Commit 70cd7272 authored by cartcrom's avatar cartcrom Committed by GitHub

fix: hide missing % changes/prices (#6046)

parent 2b5769ac
...@@ -18,8 +18,9 @@ import { putCommas } from 'nft/utils/putCommas' ...@@ -18,8 +18,9 @@ import { putCommas } from 'nft/utils/putCommas'
import { useCallback, useEffect, useState } from 'react' import { useCallback, useEffect, useState } from 'react'
import { Link, useNavigate } from 'react-router-dom' import { Link, useNavigate } from 'react-router-dom'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { ThemedText } from 'theme'
import { getDeltaArrow } from '../Tokens/TokenDetails/PriceChart' import { DeltaText, getDeltaArrow } from '../Tokens/TokenDetails/PriceChart'
import { useAddRecentlySearchedAsset } from './RecentlySearchedAssets' import { useAddRecentlySearchedAsset } from './RecentlySearchedAssets'
import * as styles from './SearchBar.css' import * as styles from './SearchBar.css'
...@@ -28,12 +29,6 @@ const PriceChangeContainer = styled.div` ...@@ -28,12 +29,6 @@ const PriceChangeContainer = styled.div`
align-items: center; align-items: center;
` `
const PriceChangeText = styled.span<{ isNegative: boolean }>`
font-size: 14px;
line-height: 20px;
color: ${({ theme, isNegative }) => (isNegative ? theme.accentFailure : theme.accentSuccess)};
`
const ArrowCell = styled.span` const ArrowCell = styled.span`
padding-top: 5px; padding-top: 5px;
padding-right: 3px; padding-right: 3px;
...@@ -191,18 +186,20 @@ export const TokenRow = ({ token, isHovered, setHoveredIndex, toggleOpen, index, ...@@ -191,18 +186,20 @@ export const TokenRow = ({ token, isHovered, setHoveredIndex, toggleOpen, index,
</Row> </Row>
<Column className={styles.suggestionSecondaryContainer}> <Column className={styles.suggestionSecondaryContainer}>
{token.market?.price?.value && ( {!!token.market?.price?.value && (
<>
<Row gap="4"> <Row gap="4">
<Box className={styles.primaryText}>{formatUSDPrice(token.market.price.value)}</Box> <Box className={styles.primaryText}>{formatUSDPrice(token.market.price.value)}</Box>
</Row> </Row>
)}
{token.market?.pricePercentChange?.value && (
<PriceChangeContainer> <PriceChangeContainer>
<ArrowCell>{arrow}</ArrowCell> <ArrowCell>{arrow}</ArrowCell>
<PriceChangeText isNegative={token.market.pricePercentChange.value < 0}> <ThemedText.BodySmall>
{Math.abs(token.market.pricePercentChange.value).toFixed(2)}% <DeltaText delta={token.market?.pricePercentChange?.value}>
</PriceChangeText> {Math.abs(token.market?.pricePercentChange?.value ?? 0).toFixed(2)}%
</DeltaText>
</ThemedText.BodySmall>
</PriceChangeContainer> </PriceChangeContainer>
</>
)} )}
</Column> </Column>
</Link> </Link>
......
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