1
1
import { useRouter } from "next/router"
2
2
import { useTranslation } from "next-i18next"
3
3
import { MdInfoOutline } from "react-icons/md"
4
- import { Box , Code , Flex , Icon , VStack } from "@chakra-ui/react"
5
4
6
5
import type { ChildOnlyProp , Lang , StakingStatsData } from "@/lib/types"
7
6
8
7
import InlineLink from "@/components/Link"
9
- import Text from "@/components/OldText"
10
8
import Tooltip from "@/components/Tooltip"
9
+ import { Flex , VStack } from "@/components/ui/flex"
11
10
12
11
import { getLocaleForNumberFormat } from "@/lib/utils/translations"
13
12
14
13
const Cell = ( { children } : ChildOnlyProp ) => (
15
- < VStack
16
- spacing = { 2 }
17
- py = { 4 }
18
- px = { 8 }
19
- borderInlineStart = { { md : "1px" } }
20
- borderTop = { { base : "1px" , md : "none" } }
21
- // `!important` needed to force an override of the user-agent
22
- borderColor = "preBorder !important"
23
- _first = { {
24
- borderInlineStart : "none" ,
25
- borderTop : "none" ,
26
- } }
27
- >
28
- { children }
29
- </ VStack >
14
+ < VStack className = "gap-2 px-8 py-4" > { children } </ VStack >
30
15
)
31
16
32
17
const Value = ( { children } : ChildOnlyProp ) => (
33
- < Code
34
- fontWeight = "bold"
35
- fontSize = "2rem"
36
- background = "none"
37
- color = "primary.base"
38
- p = { 0 }
39
- >
18
+ < code className = "inline-block bg-none p-0 pe-1 font-monospace text-3xl font-bold text-primary" >
40
19
{ children }
41
- </ Code >
20
+ </ code >
42
21
)
43
22
44
23
const Label = ( { children } : ChildOnlyProp ) => (
45
- < Flex alignItems = " center" textTransform = "uppercase" fontSize = "sm ">
24
+ < Flex className = "items- center justify-center gap-2 text-sm uppercase ">
46
25
{ children }
47
26
</ Flex >
48
27
)
49
28
50
29
// BeaconchainTooltip component
51
30
const BeaconchainTooltip = ( { children } : ChildOnlyProp ) => (
52
31
< Tooltip content = { children } >
53
- < Box as = "span" marginInlineStart = { 2 } >
54
- < Icon
55
- as = { MdInfoOutline }
56
- color = "text"
57
- _hover = { { color : "primary.base" } }
58
- _active = { { color : "primary.base" } }
59
- _focus = { { color : "primary.base" } }
60
- boxSize = { 4 }
61
- verticalAlign = "middle"
62
- />
63
- </ Box >
32
+ < MdInfoOutline className = "active:primary focus:primary h-4 w-4 align-middle hover:text-primary" />
64
33
</ Tooltip >
65
34
)
66
35
@@ -90,17 +59,17 @@ const StakingStatsBox = ({ data }: StakingStatsBoxProps) => {
90
59
const currentApr = formatPercentage ( data . apr )
91
60
92
61
return (
93
- < Flex direction = { { base : "column" , md : " row" } } >
62
+ < Flex className = "flex-col md:flex- row">
94
63
< Cell >
95
64
< Value > { totalEth } </ Value >
96
65
< Label >
97
66
{ t ( "page-staking-stats-box-metric-1" ) }
98
67
< BeaconchainTooltip >
99
- < Box textTransform = "none ">
100
- < Text > { t ( "page-staking-stats-box-metric-1-tooltip" ) } </ Text >
68
+ < div className = "normal-case ">
69
+ < p > { t ( "page-staking-stats-box-metric-1-tooltip" ) } </ p >
101
70
{ t ( "common:data-provided-by" ) } { " " }
102
71
< InlineLink href = "https://beaconcha.in/" > Beaconcha.in</ InlineLink >
103
- </ Box >
72
+ </ div >
104
73
</ BeaconchainTooltip >
105
74
</ Label >
106
75
</ Cell >
@@ -109,11 +78,11 @@ const StakingStatsBox = ({ data }: StakingStatsBoxProps) => {
109
78
< Label >
110
79
{ t ( "page-staking-stats-box-metric-2" ) }
111
80
< BeaconchainTooltip >
112
- < Box textTransform = "none ">
113
- < Text > { t ( "page-staking-stats-box-metric-2-tooltip" ) } </ Text >
81
+ < div className = "normal-case ">
82
+ < p > { t ( "page-staking-stats-box-metric-2-tooltip" ) } </ p >
114
83
{ t ( "common:data-provided-by" ) } { " " }
115
84
< InlineLink href = "https://beaconcha.in/" > Beaconcha.in</ InlineLink >
116
- </ Box >
85
+ </ div >
117
86
</ BeaconchainTooltip >
118
87
</ Label >
119
88
</ Cell >
@@ -122,13 +91,13 @@ const StakingStatsBox = ({ data }: StakingStatsBoxProps) => {
122
91
< Label >
123
92
{ t ( "page-staking-stats-box-metric-3" ) }
124
93
< BeaconchainTooltip >
125
- < Box textTransform = "none ">
126
- < Text > { t ( "page-staking-stats-box-metric-3-tooltip" ) } </ Text >
94
+ < div className = "normal-case ">
95
+ < p > { t ( "page-staking-stats-box-metric-3-tooltip" ) } </ p >
127
96
{ t ( "common:data-provided-by" ) } { " " }
128
97
< InlineLink href = "https://beaconcha.in/ethstore" >
129
98
Beaconcha.in
130
99
</ InlineLink >
131
- </ Box >
100
+ </ div >
132
101
</ BeaconchainTooltip >
133
102
</ Label >
134
103
</ Cell >
0 commit comments