1
1
import { forwardRef , useEffect , useRef , useState } from "react"
2
2
import { FaCheck } from "react-icons/fa"
3
+ import { MdClose } from "react-icons/md"
3
4
5
+ import EthGlyphSolid from "@/components/icons/eth-glyph-solid.svg"
4
6
import Tooltip from "@/components/Tooltip"
5
7
6
8
import { cn } from "@/lib/utils/cn"
7
9
8
- import { useValuesMarquee } from "../Homepage/useValuesMarquee"
10
+ import { type Pairing , useValuesMarquee } from "../Homepage/useValuesMarquee"
11
+ import { Stack } from "../ui/flex"
9
12
import {
10
13
Section ,
11
14
SectionContent ,
@@ -16,32 +19,53 @@ import {
16
19
import { usePrefersReducedMotion } from "@/hooks/usePrefersReducedMotion"
17
20
18
21
type ItemProps = React . HTMLAttributes < HTMLButtonElement > & {
19
- explanation : string [ ]
22
+ pairing : Pairing
20
23
separatorClass : string
21
- icon ?: React . ReactNode
22
24
container ?: HTMLElement | null
23
25
}
24
26
25
27
const Item = ( {
26
28
children,
27
29
className,
28
- explanation ,
30
+ pairing ,
29
31
separatorClass,
30
- icon,
31
32
container,
32
33
} : ItemProps ) => (
33
34
< >
34
35
< Tooltip
35
36
container = { container }
36
37
content = {
37
- < >
38
- < h3 className = "text-md uppercase text-body-medium" > { children } </ h3 >
39
- { explanation . map ( ( line ) => (
40
- < p key = { line } className = "text-sm" >
41
- { line }
42
- </ p >
43
- ) ) }
44
- </ >
38
+ < Stack >
39
+ < h3 className = "text-md text-body-medium dark:text-gray-300" >
40
+ { pairing . ethereum . label } x { pairing . legacy . label }
41
+ </ h3 >
42
+ < div className = "flex flex-col gap-4" >
43
+ < div className = "flex gap-2 text-body-medium" >
44
+ < div className = "p-1 text-lg" >
45
+ < MdClose />
46
+ </ div >
47
+ < div >
48
+ { pairing . legacy . content . map ( ( line ) => (
49
+ < p key = { line } className = "text-sm" >
50
+ { line }
51
+ </ p >
52
+ ) ) }
53
+ </ div >
54
+ </ div >
55
+ < div className = "flex gap-2 text-body" >
56
+ < div className = "p-1 text-lg" >
57
+ < EthGlyphSolid />
58
+ </ div >
59
+ < div className = "space-y-2" >
60
+ { pairing . ethereum . content . map ( ( line ) => (
61
+ < p key = { line } className = "text-sm" >
62
+ { line }
63
+ </ p >
64
+ ) ) }
65
+ </ div >
66
+ </ div >
67
+ </ div >
68
+ </ Stack >
45
69
}
46
70
>
47
71
< div
@@ -50,7 +74,6 @@ const Item = ({
50
74
className
51
75
) }
52
76
>
53
- { icon }
54
77
{ children }
55
78
</ div >
56
79
</ Tooltip >
@@ -122,7 +145,7 @@ const ValuesMarquee = () => {
122
145
} , [ ] )
123
146
124
147
return (
125
- < Section id = "values" className = "!my-64" >
148
+ < Section id = "values" className = "!sm: my-64 !my-48 " >
126
149
< SectionContent className = "flex flex-col items-center text-center" >
127
150
< SectionTag > { t ( "page-index:page-index-values-tag" ) } </ SectionTag >
128
151
< SectionHeader >
@@ -137,35 +160,34 @@ const ValuesMarquee = () => {
137
160
ref = { containerFirstRef }
138
161
className = "border-b border-background bg-blue-50 dark:bg-blue-600"
139
162
>
140
- { pairings . map ( ( { ethereum : { label , content } } ) => (
163
+ { pairings . map ( ( pairing ) => (
141
164
< Item
142
- key = { label }
143
- explanation = { content }
165
+ key = { pairing . ethereum . label }
144
166
container = { containerFirst }
167
+ pairing = { pairing }
145
168
separatorClass = "bg-accent-a"
146
169
className = "group/item bg-blue-100 text-blue-600 hover:bg-blue-600 hover:text-white dark:hover:bg-blue-700"
147
- icon = {
148
- < FaCheck className = "me-1 text-success group-hover/item:text-white" />
149
- }
150
170
>
151
- { label }
171
+ < FaCheck className = "me-1 text-success group-hover/item:text-white" />
172
+ { pairing . ethereum . label }
152
173
</ Item >
153
174
) ) }
154
175
</ Row >
176
+
155
177
< Row
156
178
ref = { containerSecondRef }
157
179
className = "border-t border-background bg-gray-50 dark:bg-gray-800"
158
180
toRight
159
181
>
160
- { pairings . map ( ( { legacy : { label , content } } ) => (
182
+ { pairings . map ( ( pairing ) => (
161
183
< Item
162
- key = { label }
184
+ key = { pairing . legacy . label }
163
185
container = { containerSecond }
164
- explanation = { content }
186
+ pairing = { pairing }
165
187
className = "bg-gray-200/20 text-body-medium hover:bg-gray-600 hover:text-white dark:bg-gray-950 dark:text-body"
166
188
separatorClass = "bg-gray-200 dark:bg-gray-950"
167
189
>
168
- { label }
190
+ { pairing . legacy . label }
169
191
</ Item >
170
192
) ) }
171
193
</ Row >
0 commit comments