Skip to content

Commit

Permalink
nits (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrena-orex authored Nov 23, 2024
1 parent 0cb200d commit 6fea0c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/pages/global/Staking/StakingChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ export default function StakingChart() {
payload,
label,
}: TooltipProps<ValueType, NameType>) => (
<div className="bg-third p-3 border border-white rounded-lg min-w-[20m]">
<div className="bg-third p-3 border border-white rounded-lg min-w-[12em]">
{label && <p className="text-lg mb-2 font-mono">
{label}

{payload && tokenPriceADX && tokenPriceALP ? <span className='text-xl ml-1 text-txtfade'>({
<FormatNumber
nb={payload.reduce((tmp, x) => tmp + (x.payload.ADXAmount * tokenPriceADX + x.payload.ALPAmount * tokenPriceALP), 0)}
nb={payload.reduce((tmp, x) => tmp + (x.payload[`${x.dataKey}Amount`] * (x.dataKey === 'ADX' ? tokenPriceADX : tokenPriceALP)), 0)}
precision={0}
isDecimalDimmed={false}
className={twMerge("text-lg text-txtfade")}
Expand Down Expand Up @@ -175,13 +176,13 @@ export default function StakingChart() {
/>
</span>

{tokenPriceALP ? <>
{tokenPriceALP && tokenPriceADX ? <>
<span
className={twMerge('font-mono')}
style={{ color: item.color }}
>
<FormatNumber
nb={Number(item.payload?.[`${item.dataKey}Amount`] ?? 0) * tokenPriceALP}
nb={Number(item.payload?.[`${item.dataKey}Amount`] ?? 0) * (item.dataKey === "ADX" ? tokenPriceADX : tokenPriceALP)}
precision={0}
isDecimalDimmed={false}
className={twMerge("text-sm", `text-[${item.color}]`)}
Expand Down

0 comments on commit 6fea0c4

Please sign in to comment.