Skip to content

Commit

Permalink
add delta price
Browse files Browse the repository at this point in the history
  • Loading branch information
SorinC6 committed Nov 13, 2024
1 parent 7dce676 commit 1db0c6d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ export const TokenMarketPriceOverview = ({ chartData, detailInfo, tokenInfo, isD
tokenActivity: { data24h },
} = usePortfolioTokenActivity();

const priceChangeProcent = isPrimaryToken
? detailInfo?.changePercent || changePercent
: !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price.change;
const deltaPriceChange =
!isPrimaryToken && data24h[tokenInfo?.info?.id][1].price.close - data24h[tokenInfo?.info?.id][1].price.open;
const priceChangeProcent = isPrimaryToken ? detailInfo?.changePercent || changePercent : !isEmpty(data24h) && deltaPriceChange;
const priceChangeValue = isPrimaryToken
? detailInfo?.changeValue || changeValue
: !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price.close;

return (
<Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ p: !isPrimaryToken && theme.spacing(3) }}>
<Typography fontWeight="500" color="ds.gray_max">
Expand Down

0 comments on commit 1db0c6d

Please sign in to comment.