Skip to content

Commit a9abe64

Browse files
committed
feat: migrate EnergyConsumptionChart to tailwind
1 parent 25903de commit a9abe64

File tree

1 file changed

+9
-22
lines changed
  • src/components/EnergyConsumptionChart

1 file changed

+9
-22
lines changed

src/components/EnergyConsumptionChart/index.tsx

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ import ChartDataLabels from "chartjs-plugin-datalabels"
1212
import { useRouter } from "next/router"
1313
import { useTranslation } from "next-i18next"
1414
import { Bar } from "react-chartjs-2"
15-
import {
16-
Box,
17-
Center,
18-
Text,
19-
useBreakpointValue,
20-
useColorModeValue,
21-
} from "@chakra-ui/react"
15+
import { useBreakpointValue, useColorModeValue } from "@chakra-ui/react"
2216

2317
import type { Lang } from "@/lib/types"
2418

@@ -237,26 +231,19 @@ const EnergyConsumptionChart = () => {
237231
} satisfies ChartData
238232

239233
return (
240-
<Box my={16}>
241-
<Center w="full" mb={{ base: 4, md: 6 }}>
242-
<Box
243-
position="relative"
244-
maxW="500px"
245-
m="auto"
246-
w="80vw"
247-
h={{ base: "300px", md: "400px" }}
248-
mb={{ base: 4, md: 0 }}
249-
>
234+
<div className="my-16">
235+
<div className="mb-4 flex w-full items-center justify-center md:mb-6">
236+
<div className="relative m-auto mb-4 h-[300px] w-[80vw] max-w-[500px] md:mb-0 md:h-[400px]">
250237
{isClient && (
251238
<Bar options={chartOptions} data={chartData} updateMode="none" />
252239
)}
253-
</Box>
254-
</Center>
240+
</div>
241+
</div>
255242

256-
<Text fontWeight="semibold" textAlign="center">
243+
<p className="text-center font-semibold">
257244
{t("page-what-is-ethereum-energy-consumption-chart-legend")}
258-
</Text>
259-
</Box>
245+
</p>
246+
</div>
260247
)
261248
}
262249

0 commit comments

Comments
 (0)