1
- import { Box , Flex , List , ListItem , useToken , VStack } from "@chakra-ui/react"
2
-
3
1
import type { StakingPage } from "@/lib/types"
4
2
5
3
import ButtonDropdown from "@/components/ButtonDropdown"
@@ -8,10 +6,11 @@ import {
8
6
GreenCheckProductGlyphIcon ,
9
7
WarningProductGlyphIcon ,
10
8
} from "@/components/icons/staking"
11
- import OldHeading from "@/components/OldHeading"
12
- import Text from "@/components/OldText"
13
9
import Translation from "@/components/Translation"
10
+ import { Flex , VStack } from "@/components/ui/flex"
11
+ import { List , ListItem } from "@/components/ui/list"
14
12
13
+ import { cn } from "@/lib/utils/cn"
15
14
import { trackCustomEvent } from "@/lib/utils/matomo"
16
15
17
16
import { useStakingConsiderations } from "@/hooks/useStakingConsiderations"
@@ -37,11 +36,11 @@ const IndicatorGroup = ({
37
36
return < WarningProductGlyphIcon style = { style } />
38
37
}
39
38
return (
40
- < VStack spacing = { 2 } flex = { 1 } >
39
+ < VStack className = " flex-1 gap-2" >
41
40
< IndicatorIcon style = { styleObj } />
42
- < Text fontSize = "xs" textAlign = " center" maxW = "{40} ">
41
+ < p className = "max-w-[10rem] text- center text-xs ">
43
42
< Translation id = { label } />
44
- </ Text >
43
+ </ p >
45
44
</ VStack >
46
45
)
47
46
}
@@ -51,9 +50,6 @@ export type StakingConsiderationsProps = {
51
50
}
52
51
53
52
const StakingConsiderations = ( { page } : StakingConsiderationsProps ) => {
54
- // TODO: Replace with direct token implementation after UI migration is completed
55
- const mdBp = useToken ( "breakpoints" , "md" )
56
-
57
53
const {
58
54
StyledSvg,
59
55
caution,
@@ -68,19 +64,13 @@ const StakingConsiderations = ({ page }: StakingConsiderationsProps) => {
68
64
activeIndex,
69
65
} = useStakingConsiderations ( { page } )
70
66
71
- const activeStyles = {
72
- bg : "background.highlight" ,
73
- color : "body.base" ,
74
- transition : "background 0.5s, color 0.5s" ,
75
- }
76
-
77
67
return (
78
- < Flex flexDir = { { base : "column" , md : " row" } } >
68
+ < Flex className = "flex-col md:flex- row">
79
69
< ButtonDropdown list = { dropdownLinks } className = "mb-4 md:hidden" />
80
70
{ /* TODO: Improve a11y */ }
81
- < Box flex = { 1 } hideBelow = { mdBp } >
71
+ < div className = "hidden flex-1 md:block" >
82
72
{ ! ! pageData && (
83
- < List m = { 0 } >
73
+ < List className = "m-0" >
84
74
{ /* TODO: Make mobile responsive */ }
85
75
{ pageData . map ( ( { title, matomo } , idx ) => (
86
76
< ListItem
@@ -89,45 +79,24 @@ const StakingConsiderations = ({ page }: StakingConsiderationsProps) => {
89
79
handleSelection ( idx )
90
80
trackCustomEvent ( matomo )
91
81
} }
92
- py = { 1 }
93
- cursor = "pointer"
94
- display = "table"
95
- w = "full"
96
- h = { 8 }
97
- p = "3"
98
- mb = "0"
99
- _hover = { activeStyles }
100
- position = "relative"
101
- { ...( idx === activeIndex
102
- ? activeStyles
103
- : { color : "primary.base" } ) }
82
+ className = { cn (
83
+ "transition-background relative mb-0 table h-8 w-full cursor-pointer p-3 duration-500 hover:bg-background-highlight hover:text-body" ,
84
+ idx === activeIndex
85
+ ? "bg-background-highlight text-body"
86
+ : "text-primary"
87
+ ) }
104
88
>
105
89
{ title }
106
90
</ ListItem >
107
91
) ) }
108
92
</ List >
109
93
) }
110
- </ Box >
111
- < Flex
112
- alignItems = "center"
113
- flexDir = "column"
114
- bg = "background.highlight"
115
- flex = { 2 }
116
- minH = "410px"
117
- p = { 6 }
118
- >
94
+ </ div >
95
+ < Flex className = "min-h-[410px] flex-[2] flex-col items-center bg-background-highlight p-6" >
119
96
< StyledSvg />
120
- < OldHeading
121
- as = "h3"
122
- fontWeight = { 700 }
123
- fontSize = "27px"
124
- lineHeight = { 1.4 }
125
- mt = { 10 }
126
- >
127
- { title }
128
- </ OldHeading >
129
- < Text > { description } </ Text >
130
- < Flex gap = { 8 } justifyContent = "center" mt = "auto" >
97
+ < h3 className = "mt-10 text-2xl font-bold leading-[1.4]" > { title } </ h3 >
98
+ < p > { description } </ p >
99
+ < Flex className = "mt-auto justify-center gap-8" >
131
100
{ ! ! valid && (
132
101
< IndicatorGroup
133
102
label = { valid }
0 commit comments