Skip to content

Commit 255a5e3

Browse files
committed
feat: implement desktop layout details
1 parent d97bcff commit 255a5e3

File tree

3 files changed

+55
-27
lines changed

3 files changed

+55
-27
lines changed

src/components/Homepage/ValuesMarquee.tsx

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { forwardRef, useEffect, useRef, useState } from "react"
22
import { FaCheck } from "react-icons/fa"
3+
import { MdClose } from "react-icons/md"
34

5+
import EthGlyphSolid from "@/components/icons/eth-glyph-solid.svg"
46
import Tooltip from "@/components/Tooltip"
57

68
import { cn } from "@/lib/utils/cn"
79

8-
import { useValuesMarquee } from "../Homepage/useValuesMarquee"
10+
import { type Pairing, useValuesMarquee } from "../Homepage/useValuesMarquee"
11+
import { Stack } from "../ui/flex"
912
import {
1013
Section,
1114
SectionContent,
@@ -16,32 +19,53 @@ import {
1619
import { usePrefersReducedMotion } from "@/hooks/usePrefersReducedMotion"
1720

1821
type ItemProps = React.HTMLAttributes<HTMLButtonElement> & {
19-
explanation: string[]
22+
pairing: Pairing
2023
separatorClass: string
21-
icon?: React.ReactNode
2224
container?: HTMLElement | null
2325
}
2426

2527
const Item = ({
2628
children,
2729
className,
28-
explanation,
30+
pairing,
2931
separatorClass,
30-
icon,
3132
container,
3233
}: ItemProps) => (
3334
<>
3435
<Tooltip
3536
container={container}
3637
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>
4569
}
4670
>
4771
<div
@@ -50,7 +74,6 @@ const Item = ({
5074
className
5175
)}
5276
>
53-
{icon}
5477
{children}
5578
</div>
5679
</Tooltip>
@@ -122,7 +145,7 @@ const ValuesMarquee = () => {
122145
}, [])
123146

124147
return (
125-
<Section id="values" className="!my-64">
148+
<Section id="values" className="!sm:my-64 !my-48">
126149
<SectionContent className="flex flex-col items-center text-center">
127150
<SectionTag>{t("page-index:page-index-values-tag")}</SectionTag>
128151
<SectionHeader>
@@ -137,35 +160,34 @@ const ValuesMarquee = () => {
137160
ref={containerFirstRef}
138161
className="border-b border-background bg-blue-50 dark:bg-blue-600"
139162
>
140-
{pairings.map(({ ethereum: { label, content } }) => (
163+
{pairings.map((pairing) => (
141164
<Item
142-
key={label}
143-
explanation={content}
165+
key={pairing.ethereum.label}
144166
container={containerFirst}
167+
pairing={pairing}
145168
separatorClass="bg-accent-a"
146169
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-
}
150170
>
151-
{label}
171+
<FaCheck className="me-1 text-success group-hover/item:text-white" />
172+
{pairing.ethereum.label}
152173
</Item>
153174
))}
154175
</Row>
176+
155177
<Row
156178
ref={containerSecondRef}
157179
className="border-t border-background bg-gray-50 dark:bg-gray-800"
158180
toRight
159181
>
160-
{pairings.map(({ legacy: { label, content } }) => (
182+
{pairings.map((pairing) => (
161183
<Item
162-
key={label}
184+
key={pairing.legacy.label}
163185
container={containerSecond}
164-
explanation={content}
186+
pairing={pairing}
165187
className="bg-gray-200/20 text-body-medium hover:bg-gray-600 hover:text-white dark:bg-gray-950 dark:text-body"
166188
separatorClass="bg-gray-200 dark:bg-gray-950"
167189
>
168-
{label}
190+
{pairing.legacy.label}
169191
</Item>
170192
))}
171193
</Row>

src/components/Homepage/useValuesMarquee.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type Item = {
55
content: string[]
66
}
77

8-
type Pairing = {
8+
export type Pairing = {
99
legacy: Item
1010
ethereum: Item
1111
}
Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)