Skip to content

Commit 18b7a05

Browse files
authored
Merge pull request #13922 from ethereum/staging
Staging
2 parents 77b43fe + 8b89842 commit 18b7a05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3744
-2121
lines changed

src/@chakra-ui/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import semanticTokens from "./semanticTokens"
66

77
const config: ThemeConfig = {
88
cssVarPrefix: "eth",
9-
initialColorMode: "system",
9+
initialColorMode: "light",
1010
/**
1111
* Disable Chakra's system color subscription, as it works differently from
1212
* `next-themes` and causes a desync with it.

src/components/BannerGrid/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export const BannerGridCell = ({ children }: ChildOnlyProp) => {
3636
className={cn(
3737
"px-0 py-8 md:px-12",
3838
"flex-col",
39-
"border-t border-t-search-background",
40-
"md:border-s md:border-s-search-background",
39+
"border-t-search-background border-t",
40+
"md:border-s-search-background md:border-s",
4141
"first:border-t-0",
4242
"lg:[&:first-child]:border-s-0",
43-
"md:[&:nth-child(-n+2)]:border-t-0 lg:[&:nth-child(-n+2)]:border-t lg:[&:nth-child(-n+2)]:border-t-search-background",
44-
"md:[&:nth-child(2n+1)]:border-s-0 lg:[&:nth-child(2n+1)]:border-s lg:[&:nth-child(2n+1)]:border-s-search-background",
43+
"lg:[&:nth-child(-n+2)]:border-t-search-background md:[&:nth-child(-n+2)]:border-t-0 lg:[&:nth-child(-n+2)]:border-t",
44+
"lg:[&:nth-child(2n+1)]:border-s-search-background md:[&:nth-child(2n+1)]:border-s-0 lg:[&:nth-child(2n+1)]:border-s",
4545
"lg:[&:nth-child(-n+3)]:justify-start lg:[&:nth-child(-n+3)]:border-t-0 lg:[&:nth-child(-n+3)]:pt-0",
4646
"lg:[&:nth-child(3n+1)]:border-s-0 lg:[&:nth-child(3n+1)]:ps-0",
4747
"lg:[&:nth-child(n+4)]:justify-start lg:[&:nth-child(n+4)]:pb-0"

src/components/Buttons/SvgButtonLink.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import { cva, VariantProps } from "class-variance-authority"
2-
import type { FC, ReactNode, SVGProps } from "react"
2+
import type { FC, SVGProps } from "react"
33

44
import { cn } from "@/lib/utils/cn"
55

6-
import { BaseLink } from "../ui/Link"
7-
8-
type SvgButtonLinkProps = {
9-
Svg: FC<SVGProps<SVGElement>>
10-
label?: string
11-
children: ReactNode
12-
href: string
13-
className?: string
14-
size?: number
15-
}
6+
import { BaseLink, LinkProps } from "../ui/Link"
167

178
const variants = cva("flex items-center gap-3.5", {
189
variants: {
@@ -28,14 +19,20 @@ const variants = cva("flex items-center gap-3.5", {
2819

2920
type Variants = VariantProps<typeof variants>
3021

22+
export type SvgButtonLinkProps = LinkProps & {
23+
Svg: FC<SVGProps<SVGElement>>
24+
label?: string
25+
size?: number
26+
} & Variants
27+
3128
const SvgButtonLink = ({
3229
label,
3330
children,
3431
Svg,
3532
className,
3633
variant,
3734
...props
38-
}: SvgButtonLinkProps & Variants) => (
35+
}: SvgButtonLinkProps) => (
3936
<BaseLink
4037
className={cn(
4138
"group rounded-2xl no-underline focus:outline focus:outline-4 focus:outline-offset-8",

src/components/Hero/HomeHero/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const HomeHero = ({ heroImg, className }: HomeHeroProps) => {
2626
<Morpher />
2727
<div className="flex flex-col items-center gap-y-5 lg:max-w-2xl">
2828
<h1 className="font-black">{t("page-index:page-index-title")}</h1>
29-
<p className="max-w-96 text-body-medium">
29+
<p className="max-w-96 text-md text-body-medium lg:text-lg">
3030
{t("page-index:page-index-description")}
3131
</p>
3232
</div>

src/components/Homepage/BentoCard.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type BentoCardProps = HTMLAttributes<HTMLDivElement> & {
1717
imgWidth?: number
1818
imgHeight?: number
1919
title: string
20+
eventName: string
2021
}
2122

2223
const BentoCard = ({
@@ -28,6 +29,7 @@ const BentoCard = ({
2829
imgWidth,
2930
imgHeight,
3031
title,
32+
eventName,
3133
}: BentoCardProps) => (
3234
<Card
3335
className={cn(
@@ -43,7 +45,16 @@ const BentoCard = ({
4345
{title}
4446
</CardTitle>
4547
<p className="mb-8 text-md">{children}</p>
46-
<ButtonLink href={href} variant="outline" isSecondary>
48+
<ButtonLink
49+
href={href}
50+
variant="outline"
51+
isSecondary
52+
customEventOptions={{
53+
eventCategory: "Homepage",
54+
eventAction: "use cases",
55+
eventName,
56+
}}
57+
>
4758
{action} <ChevronNext />
4859
</ButtonLink>
4960
</div>
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
import { forwardRef, useEffect, useRef, useState } from "react"
2+
import { FaCheck } from "react-icons/fa"
3+
import { MdClose } from "react-icons/md"
4+
5+
import EthGlyphSolid from "@/components/icons/eth-glyph-solid.svg"
6+
import Tooltip from "@/components/Tooltip"
7+
8+
import { cn } from "@/lib/utils/cn"
9+
import { isMobile } from "@/lib/utils/isMobile"
10+
import { trackCustomEvent } from "@/lib/utils/matomo"
11+
12+
import { type Pairing, useValuesMarquee } from "../Homepage/useValuesMarquee"
13+
import { Stack } from "../ui/flex"
14+
import {
15+
Section,
16+
SectionContent,
17+
SectionHeader,
18+
SectionTag,
19+
} from "../ui/section"
20+
21+
import { usePrefersReducedMotion } from "@/hooks/usePrefersReducedMotion"
22+
23+
type ItemProps = React.HTMLAttributes<HTMLButtonElement> & {
24+
pairing: Pairing
25+
separatorClass: string
26+
container?: HTMLElement | null
27+
label: string
28+
}
29+
30+
const Item = ({
31+
children,
32+
className,
33+
pairing,
34+
separatorClass,
35+
container,
36+
label,
37+
}: ItemProps) => (
38+
<>
39+
<Tooltip
40+
container={container}
41+
onBeforeOpen={() => {
42+
trackCustomEvent({
43+
eventCategory: "Homepage",
44+
eventAction: "internet_changing",
45+
eventName: label,
46+
})
47+
}}
48+
content={
49+
<Stack>
50+
<h3 className="text-md text-body-medium dark:text-gray-300">
51+
{label}
52+
</h3>
53+
<div className="flex flex-col gap-4">
54+
<div className="flex gap-2 text-body-medium">
55+
<div className="p-1 text-lg">
56+
<MdClose />
57+
</div>
58+
<div>
59+
{pairing.legacy.content.map((line) => (
60+
<p key={line} className="text-sm">
61+
{line}
62+
</p>
63+
))}
64+
</div>
65+
</div>
66+
<div className="flex gap-2 text-body">
67+
<div className="p-1 text-lg">
68+
<EthGlyphSolid />
69+
</div>
70+
<div className="flex flex-col gap-2">
71+
{pairing.ethereum.content.map((line) => (
72+
<p key={line} className="text-sm">
73+
{line}
74+
</p>
75+
))}
76+
</div>
77+
</div>
78+
</div>
79+
</Stack>
80+
}
81+
>
82+
<div
83+
className={cn(
84+
"flex flex-nowrap items-center text-nowrap rounded-full px-4 py-1 font-bold uppercase",
85+
className
86+
)}
87+
>
88+
{children}
89+
</div>
90+
</Tooltip>
91+
<div
92+
className={cn(
93+
"h-1.5 min-w-1.5 rounded-full motion-reduce:last:hidden",
94+
separatorClass
95+
)}
96+
/>
97+
</>
98+
)
99+
100+
type RowProps = React.HTMLAttributes<HTMLDivElement> & {
101+
toRight?: boolean
102+
}
103+
104+
const Row = forwardRef<HTMLDivElement, RowProps>(
105+
({ className, children, toRight }, ref) => {
106+
const { prefersReducedMotion } = usePrefersReducedMotion()
107+
const fadeEdges = {
108+
mask: `linear-gradient(to right, transparent 1rem, white 15%, white 85%, transparent calc(100% - 1rem))`,
109+
}
110+
111+
return (
112+
<div ref={ref} className={cn("group", className)}>
113+
<div
114+
className="flex max-w-full overflow-hidden motion-reduce:overflow-auto"
115+
style={prefersReducedMotion ? {} : fadeEdges}
116+
>
117+
{Array(prefersReducedMotion ? 1 : 3)
118+
.fill(0)
119+
.map((_, idx) => (
120+
<div
121+
key={idx}
122+
className={cn(
123+
"flex min-w-fit items-center space-x-10 px-6 py-8 motion-reduce:w-full motion-reduce:animate-none motion-reduce:justify-center",
124+
isMobile()
125+
? "group-has-[button:hover]:animate-pause"
126+
: "group-hover:animate-pause",
127+
toRight ? "animate-scroll-right" : "animate-scroll-left"
128+
)}
129+
>
130+
{children}
131+
</div>
132+
))}
133+
</div>
134+
</div>
135+
)
136+
}
137+
)
138+
Row.displayName = "Row"
139+
140+
const ValuesMarquee = () => {
141+
const { t, pairings } = useValuesMarquee()
142+
const containerFirstRef = useRef<HTMLDivElement>(null)
143+
const containerSecondRef = useRef<HTMLDivElement>(null)
144+
145+
const [containerFirst, setContainerFirst] = useState<HTMLDivElement | null>(
146+
null
147+
)
148+
const [containerSecond, setContainerSecond] = useState<HTMLDivElement | null>(
149+
null
150+
)
151+
152+
useEffect(() => {
153+
if (containerFirstRef.current) {
154+
setContainerFirst(containerFirstRef.current)
155+
}
156+
if (containerSecondRef.current) {
157+
setContainerSecond(containerSecondRef.current)
158+
}
159+
}, [])
160+
161+
return (
162+
<Section id="values" className="!sm:my-64 !my-48 scroll-m-48">
163+
<SectionContent className="flex flex-col items-center text-center">
164+
<SectionTag>{t("page-index:page-index-values-tag")}</SectionTag>
165+
<SectionHeader>
166+
{t("page-index:page-index-values-header")}
167+
</SectionHeader>
168+
<p className="text-lg text-body-medium">
169+
{t("page-index:page-index-values-description")}
170+
</p>
171+
</SectionContent>
172+
<div className="relative mt-19 overflow-hidden max-2xl:-mx-4 2xl:rounded-2xl">
173+
<Row
174+
ref={containerFirstRef}
175+
className="border-b border-background bg-blue-50 dark:bg-blue-600"
176+
>
177+
{pairings.map((pairing) => (
178+
<Item
179+
key={pairing.ethereum.label}
180+
label={pairing.ethereum.label}
181+
container={containerFirst}
182+
pairing={pairing}
183+
separatorClass="bg-accent-a"
184+
className="group/item bg-blue-100 text-blue-600 hover:bg-blue-600 hover:text-white dark:hover:bg-blue-700"
185+
>
186+
<FaCheck className="me-1 text-success group-hover/item:text-white" />
187+
{pairing.ethereum.label}
188+
</Item>
189+
))}
190+
</Row>
191+
192+
<Row
193+
ref={containerSecondRef}
194+
className="border-t border-background bg-gray-50 dark:bg-gray-800"
195+
toRight
196+
>
197+
{pairings.map((pairing) => (
198+
<Item
199+
key={pairing.legacy.label}
200+
label={pairing.legacy.label}
201+
container={containerSecond}
202+
pairing={pairing}
203+
className="bg-gray-200/20 text-body-medium hover:bg-gray-600 hover:text-white dark:bg-gray-950 dark:text-body"
204+
separatorClass="bg-gray-200 dark:bg-gray-950"
205+
>
206+
{pairing.legacy.label}
207+
</Item>
208+
))}
209+
</Row>
210+
211+
<div className="absolute start-[50%] top-[50%] flex -translate-x-[50%] -translate-y-[50%] items-center overflow-hidden rounded-lg text-sm font-bold">
212+
<p className="bg-gray-50 px-4 py-1 text-body-medium dark:bg-gray-800 dark:text-gray-200">
213+
{t("page-index-values-legacy")}
214+
</p>
215+
216+
<div
217+
className={cn(
218+
"border-t-[15px] border-t-blue-50 dark:border-t-blue-600",
219+
"border-r-8 border-r-blue-50 dark:border-r-blue-600",
220+
"border-b-[15px] border-b-gray-50 dark:border-b-gray-800",
221+
"border-l-8 border-l-gray-50 dark:border-l-gray-800"
222+
)}
223+
/>
224+
225+
<p className="bg-blue-50 px-4 py-1 text-accent-a dark:bg-blue-600 dark:text-white">
226+
{t("common:ethereum")}
227+
</p>
228+
</div>
229+
</div>
230+
</Section>
231+
)
232+
}
233+
234+
export default ValuesMarquee

src/components/Homepage/useBentoBox.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type CopyDetails = {
1717
children: string
1818
action: string
1919
href: string
20+
eventName: Category
2021
}
2122

2223
const gradientStops = "from-20% to-60%"
@@ -100,6 +101,7 @@ export const useBentoBox = () => {
100101
children: t(`page-index:page-index-bento-${category}-content`),
101102
action: t(`page-index:page-index-bento-${category}-action`),
102103
href,
104+
eventName: category,
103105
})
104106

105107
return [

0 commit comments

Comments
 (0)