Skip to content

Commit 253c16f

Browse files
authored
Merge pull request #15697 from ethereum/staging
Staging
2 parents 4cbc4fb + 8447b22 commit 253c16f

File tree

12 files changed

+311
-301
lines changed

12 files changed

+311
-301
lines changed

app/[locale]/enterprise/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import Checkmark from "@/components/icons/checkmark.svg"
99
import Adidas from "@/components/icons/enterprise/adidas.svg"
1010
import Azure from "@/components/icons/enterprise/azure.svg"
1111
import BancoSantander from "@/components/icons/enterprise/banco-santander.svg"
12-
import BASF from "@/components/icons/enterprise/basf.svg"
1312
import BlackRock from "@/components/icons/enterprise/blackrock.svg"
1413
import BMW from "@/components/icons/enterprise/bmw.svg"
1514
import CocaCola from "@/components/icons/enterprise/coca-cola.svg"
@@ -183,8 +182,13 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
183182
),
184183
},
185184
{
186-
name: "T-Mobile & SK Telecom",
187-
content: t("page-enterprise-cases-tmobile-content"),
185+
name: "Sony",
186+
content: (
187+
<Translation
188+
ns="page-enterprise"
189+
id="page-enterprise-cases-sony-content"
190+
/>
191+
),
188192
},
189193
{
190194
name: "UN World Food Programme",
@@ -233,7 +237,6 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
233237
Logo: BancoSantander,
234238
className: "-translate-y-1",
235239
},
236-
{ name: "BASF", Logo: BASF, className: "text-[28px]" },
237240
{ name: "BlackRock", Logo: BlackRock, className: "text-[32px]" },
238241
{ name: "BMW", Logo: BMW, className: "scale-105 origin-bottom" },
239242
{ name: "Coca-Cola", Logo: CocaCola },
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"use client"
2+
3+
import { motion } from "framer-motion"
4+
5+
import { ButtonLink } from "@/components/ui/buttons/Button"
6+
7+
import { cn } from "@/lib/utils/cn"
8+
9+
import type { DashboardSection } from "../types"
10+
11+
import { useActiveHash } from "@/hooks/useActiveHash"
12+
13+
const ResourcesNav = ({
14+
resourceSections,
15+
eventCategory,
16+
}: {
17+
resourceSections: DashboardSection[]
18+
eventCategory: string
19+
}) => {
20+
const activeSection = useActiveHash(
21+
resourceSections.map(({ key }) => key),
22+
"0% 0% -70% 0%"
23+
).replace(/^#/, "")
24+
25+
return (
26+
<nav className="z-sticky mx-4 flex max-w-full gap-1 overflow-x-auto bg-background p-2 shadow md:max-w-[calc(100%-2rem)] md:rounded-2xl md:border md:p-0.5 md:shadow-lg">
27+
{resourceSections.map(({ key, title, icon }) => (
28+
<ButtonLink
29+
key={key}
30+
href={`#${key}`}
31+
variant="ghost"
32+
isSecondary
33+
className={cn(
34+
"relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm",
35+
activeSection === key && "!text-primary"
36+
)}
37+
customEventOptions={{
38+
eventCategory,
39+
eventAction: "whats_on_this_page",
40+
eventName: key,
41+
}}
42+
>
43+
{activeSection === key && (
44+
<motion.div
45+
layoutId="active-section-highlight"
46+
className="absolute inset-0 z-0 rounded-xl bg-primary-low-contrast"
47+
/>
48+
)}
49+
{icon && <span className="z-10 text-lg">{icon}</span>}
50+
<span className="relative z-10">{title}</span>
51+
</ButtonLink>
52+
))}
53+
</nav>
54+
)
55+
}
56+
57+
export default ResourcesNav

src/components/Resources/index.tsx renamed to app/[locale]/resources/_components/ResourcesUI.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import { Tag } from "@/components/ui/tag"
33

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

6-
import { Image } from "../Image"
7-
8-
import { Item } from "./types"
6+
import { Image } from "../../../../src/components/Image"
7+
import { Item } from "../types"
98

109
export const DashboardBox = ({
1110
className,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"use client"
2+
3+
import { useEffect, useState } from "react"
4+
import { useLocale } from "next-intl"
5+
6+
import RadialChart from "@/components/RadialChart"
7+
8+
const SlotCountdownChart = ({ children }: { children: string }) => {
9+
const [timeToNextBlock, setTimeToNextBlock] = useState(12)
10+
const locale = useLocale()
11+
12+
useEffect(() => {
13+
const genesisTime = new Date("2020-12-01T12:00:23Z").getTime()
14+
const updateTime = () => {
15+
const now = Date.now()
16+
const timeElapsed = (now - genesisTime) / 1000
17+
const timeToNext = 12 - (timeElapsed % 12)
18+
setTimeToNextBlock(Math.floor(timeToNext) || 12)
19+
}
20+
21+
updateTime()
22+
const interval = setInterval(updateTime, 1000)
23+
return () => clearInterval(interval)
24+
}, [])
25+
26+
return (
27+
<RadialChart
28+
value={timeToNextBlock}
29+
totalValue={12}
30+
displayValue={new Intl.NumberFormat(locale, {
31+
style: "unit",
32+
unit: "second",
33+
unitDisplay: "narrow",
34+
}).format(timeToNextBlock)}
35+
label={children}
36+
/>
37+
)
38+
}
39+
40+
export default SlotCountdownChart

app/[locale]/resources/_components/resources.tsx

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)