@@ -12,19 +12,16 @@ import ChartDataLabels from "chartjs-plugin-datalabels"
12
12
import { useRouter } from "next/router"
13
13
import { useTranslation } from "next-i18next"
14
14
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 } from "@chakra-ui/react"
22
16
23
17
import type { Lang } from "@/lib/types"
24
18
19
+ import { Center } from "@/components/ui/flex"
20
+
25
21
import { wrapLabel } from "@/lib/utils/charts"
26
22
import { isLangRightToLeft } from "@/lib/utils/translations"
27
23
24
+ import useColorModeValue from "@/hooks/useColorModeValue"
28
25
import { useIsClient } from "@/hooks/useIsClient"
29
26
30
27
// ChartDataLabels required to display y-labels on top of bars
@@ -237,26 +234,19 @@ const EnergyConsumptionChart = () => {
237
234
} satisfies ChartData
238
235
239
236
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
- >
237
+ < div className = "my-16" >
238
+ < Center className = "mb-4 w-full md:mb-6" >
239
+ < div className = "relative m-auto mb-4 h-[300px] w-[80vw] max-w-[500px] md:mb-0 md:h-[400px]" >
250
240
{ isClient && (
251
241
< Bar options = { chartOptions } data = { chartData } updateMode = "none" />
252
242
) }
253
- </ Box >
243
+ </ div >
254
244
</ Center >
255
245
256
- < Text fontWeight = "semibold" textAlign = " center">
246
+ < p className = "text- center font-semibold ">
257
247
{ t ( "page-what-is-ethereum-energy-consumption-chart-legend" ) }
258
- </ Text >
259
- </ Box >
248
+ </ p >
249
+ </ div >
260
250
)
261
251
}
262
252
0 commit comments