diff --git a/src/components/shared/card/crypto_card.js b/src/components/shared/card/crypto_card.js index 09b914913..a308ee8fe 100644 --- a/src/components/shared/card/crypto_card.js +++ b/src/components/shared/card/crypto_card.js @@ -20,15 +20,18 @@ const CryptoCard = ({ currency = '', lineGraph = null, price = 0, - fluctuating = 0, + fluctuating = -1, star = false, starred = false, ...otherProps }) => { price = price > 0.001 ? price.toLocaleString() : price; - let priceUp = fluctuating > 0 ? true : false; - let fluctuatingRate = priceUp ? `(+${fluctuating}%)▴` : `(-${fluctuating}%)▾`; - const priceColor = priceUp ? `text-green-400` : `text-red-400`; + fluctuating = Number(fluctuating); + // console.log('fluctuating', fluctuating); + let priceRise = fluctuating > 0 ? true : false; + let fluctuatingRate = priceRise ? `(+${fluctuating}%)▴` : `(${fluctuating}%)▾`; + const priceColor = priceRise ? `text-green-400` : `text-red-400`; + // console.log('priceColor', priceColor); const upSvg = ( +
@@ -84,10 +87,8 @@ const CryptoCard = ({
- - + {/**@note no default text color, for it will make real text color not work */} +

{price ? `$ ${price}` : '$17,414'}

{fluctuatingRate ? fluctuatingRate : '(+11.1%)'}