Skip to content

Commit

Permalink
Update ShieldedPoolChart.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
zksquirrel authored Aug 6, 2024
1 parent b4fcf4c commit 3b4124f
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/components/ShieldedPoolChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ const ShieldedPoolChart = withTooltip<AreaProps & ShieldedPoolChartProps, Shield

const yMax = useMemo(() => max(chartData, getShieldedValue) || 0, [chartData]);

/* State for total shielded amount */
const [totalShielded, setTotalShielded] = useState(0);

/* Loading state for chart data in progress */
const [isLoading, setIsLoading] = useState(false);

Expand All @@ -130,11 +127,7 @@ const ShieldedPoolChart = withTooltip<AreaProps & ShieldedPoolChartProps, Shield
useEffect(() => {
setIsLoading(true);
fetchShieldedSupplyData(dataUrl)
.then((data) => {
setChartData(data);
const total = data.reduce((sum, datum) => sum + getShieldedValue(datum), 0);
setTotalShielded(total);
})
.then((data) => setChartData(data))
.catch((error) => setError(error))
.finally(() => setIsLoading(false));
}, [dataUrl]);
Expand Down Expand Up @@ -374,10 +367,6 @@ const ShieldedPoolChart = withTooltip<AreaProps & ShieldedPoolChartProps, Shield
</Tooltip>
</div>
)}
<div style={{ textAlign: 'center', marginTop: '10px' }}>
<button>Total Shielded</button>
<p style={{ color: accentColor }}>{formatNumber(totalShielded)}</p>
</div>
</div>
);
},
Expand Down

0 comments on commit 3b4124f

Please sign in to comment.