From 87579c0c5f95f67caec46d39a001d1a4ab09ff5d Mon Sep 17 00:00:00 2001 From: Madalina Raicu Date: Fri, 2 Feb 2024 15:55:44 +0000 Subject: [PATCH] fix(trading): update price change --- .../market-header/mobile-market-header.tsx | 1 + .../last-24h-price-change/last-24h-price-change.tsx | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/trading/components/market-header/mobile-market-header.tsx b/apps/trading/components/market-header/mobile-market-header.tsx index df1687415..280505a38 100644 --- a/apps/trading/components/market-header/mobile-market-header.tsx +++ b/apps/trading/components/market-header/mobile-market-header.tsx @@ -71,6 +71,7 @@ export const MobileMarketHeader = () => { { const t = useT(); - const { isMobile } = useScreenDimensions(); const { oneDayCandles, error, fiveDaysCandles } = useCandles({ marketId, }); @@ -36,8 +37,8 @@ export const Last24hPriceChange = ({ fiveDaysCandles.length > 0 && (!oneDayCandles || oneDayCandles?.length === 0) ) { - // if there is no change and no percentage, we don't show anything on mobile - if (isMobile) { + // render nothing instead of '-' when there is no price change + if (hideZero) { return null; } return ( @@ -67,8 +68,8 @@ export const Last24hPriceChange = ({ const change = priceChange(candles); const changePercentage = priceChangePercentage(candles); - // if there is no change and no percentage, we don't show anything on mobile - if (!change && !changePercentage && isMobile) { + // render nothing instead of '-' when there is no price change + if (!change && !changePercentage && hideZero) { return null; }