From 8b34c1375be6478295ab533bdd230c656d7560f9 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 17:14:31 +0100 Subject: [PATCH] feat: show less data on mobile --- frontend/src/components/BarGraph.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/BarGraph.tsx b/frontend/src/components/BarGraph.tsx index 8a3c166..a167cf0 100644 --- a/frontend/src/components/BarGraph.tsx +++ b/frontend/src/components/BarGraph.tsx @@ -24,6 +24,10 @@ export function BarGraph({ title, chartData, chartConfig, info }: { const filteredData = chartData.filter(data => data.ingestPrice !== null || data.outputPrice !== null); + const isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed + + const displayedData = isMobile ? filteredData.slice(0, 4) : filteredData; + return (
@@ -34,7 +38,7 @@ export function BarGraph({ title, chartData, chartConfig, info }: { - +
) -} +} \ No newline at end of file