Skip to content

Commit 0a9ed7d

Browse files
authored
Merge pull request #15266 from ethereum/dev
mini release candidate
2 parents 89d310e + baaf8d1 commit 0a9ed7d

File tree

130 files changed

+2888
-4268
lines changed

Some content is hidden

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

130 files changed

+2888
-4268
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12715,6 +12715,15 @@
1271512715
"contributions": [
1271612716
"code"
1271712717
]
12718+
},
12719+
{
12720+
"login": "JJOptimist",
12721+
"name": "JJOptimist",
12722+
"avatar_url": "https://avatars.githubusercontent.com/u/86833563?v=4",
12723+
"profile": "https://github.com/JJOptimist",
12724+
"contributions": [
12725+
"bug"
12726+
]
1271812727
}
1271912728
],
1272012729
"contributorsPerLine": 7,

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { addons } from "@storybook/manager-api"
22

3-
import favicon from "../public/images/favicon.png"
3+
import favicon from "../public/images/eth-home-icon.png"
44

55
import theme from "./theme"
66

.storybook/preview-head.html

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

.storybook/preview.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import isChromatic from "chromatic/isChromatic"
22
import { MotionGlobalConfig } from "framer-motion"
3+
import { IBM_Plex_Mono, Inter } from "next/font/google"
34
import type { Preview } from "@storybook/react"
45

56
import ThemeProvider from "@/components/ThemeProvider"
@@ -9,11 +10,24 @@ import nextIntl, { baseLocales } from "./next-intl"
910
import { withNextThemes } from "./withNextThemes"
1011

1112
import "../src/styles/global.css"
12-
import "../src/styles/fonts.css"
1313
import "../src/styles/docsearch.css"
1414

1515
import "@docsearch/css"
1616

17+
const inter = Inter({
18+
subsets: ["latin"],
19+
display: "swap",
20+
variable: "--font-inter",
21+
preload: true,
22+
})
23+
24+
const ibmPlexMono = IBM_Plex_Mono({
25+
subsets: ["latin"],
26+
weight: ["400"],
27+
display: "swap",
28+
variable: "--font-mono",
29+
})
30+
1731
MotionGlobalConfig.skipAnimations = isChromatic()
1832

1933
export const breakpointSet: [token: string, value: string][] = [
@@ -39,11 +53,13 @@ const preview: Preview = {
3953
defaultTheme: "light",
4054
}),
4155
(Story) => (
42-
<ThemeProvider>
43-
<TooltipProvider>
44-
<Story />
45-
</TooltipProvider>
46-
</ThemeProvider>
56+
<div className={`${inter.variable} ${ibmPlexMono.variable}`}>
57+
<ThemeProvider>
58+
<TooltipProvider>
59+
<Story />
60+
</TooltipProvider>
61+
</ThemeProvider>
62+
</div>
4763
),
4864
],
4965
parameters: {

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
19451945
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jenish-thapa"><img src="https://avatars.githubusercontent.com/u/141203631?v=4?s=100" width="100px;" alt="Jenish Thapa"/><br /><sub><b>Jenish Thapa</b></sub></a><br /><a href="#ideas-jenish-thapa" title="Ideas, Planning, & Feedback">🤔</a></td>
19461946
<td align="center" valign="top" width="14.28%"><a href="https://jiangxue.org/~ritsu"><img src="https://avatars.githubusercontent.com/u/57232813?v=4?s=100" width="100px;" alt="iusx"/><br /><sub><b>iusx</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=iusx" title="Code">💻</a></td>
19471947
</tr>
1948+
<tr>
1949+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JJOptimist"><img src="https://avatars.githubusercontent.com/u/86833563?v=4?s=100" width="100px;" alt="JJOptimist"/><br /><sub><b>JJOptimist</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AJJOptimist" title="Bug reports">🐛</a></td>
1950+
</tr>
19481951
</tbody>
19491952
</table>
19501953

src/pages/[locale]/index.tsx renamed to app/[locale]/_components/home.tsx

Lines changed: 26 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
"use client"
2+
13
import { Fragment, lazy, Suspense } from "react"
2-
import type { GetStaticProps, InferGetStaticPropsType } from "next"
34
import { FaDiscord, FaGithub } from "react-icons/fa6"
45
import { IoMdCopy } from "react-icons/io"
56
import { MdCheck } from "react-icons/md"
@@ -8,11 +9,11 @@ import type {
89
AllMetricData,
910
BasePageProps,
1011
CommunityBlog,
11-
Lang,
12-
Params,
1312
RSSItem,
1413
} from "@/lib/types"
14+
import { CommunityEvent } from "@/lib/interfaces"
1515

16+
import BannerNotification from "@/components/Banners/BannerNotification"
1617
import { ChevronNext } from "@/components/Chevron"
1718
import CodeModal from "@/components/CodeModal"
1819
import HomeHero from "@/components/Hero/HomeHero"
@@ -24,8 +25,12 @@ import Calendar from "@/components/icons/calendar.svg"
2425
import CalendarAdd from "@/components/icons/calendar-add.svg"
2526
import { Image } from "@/components/Image"
2627
import MainArticle from "@/components/MainArticle"
27-
import PageMetadata from "@/components/PageMetadata"
28-
import { TranslatathonBanner } from "@/components/Translatathon/TranslatathonBanner"
28+
import {
29+
Accordion,
30+
AccordionContent,
31+
AccordionItem,
32+
AccordionTrigger,
33+
} from "@/components/ui/accordion"
2934
import { Button, ButtonLink } from "@/components/ui/buttons/Button"
3035
import SvgButtonLink, {
3136
type SvgButtonLinkProps,
@@ -56,43 +61,13 @@ import {
5661
import WindowBox from "@/components/WindowBox"
5762

5863
import { cn } from "@/lib/utils/cn"
59-
import { dataLoader } from "@/lib/utils/data/dataLoader"
6064
import { isValidDate } from "@/lib/utils/date"
61-
import { existsNamespace } from "@/lib/utils/existsNamespace"
62-
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
6365
import { trackCustomEvent } from "@/lib/utils/matomo"
64-
import { polishRSSList } from "@/lib/utils/rss"
6566
import { breakpointAsNumber } from "@/lib/utils/screen"
66-
import { getLocaleTimestamp } from "@/lib/utils/time"
67-
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
6867

69-
import {
70-
BASE_TIME_UNIT,
71-
BLOG_FEEDS,
72-
BLOGS_WITHOUT_FEED,
73-
CALENDAR_DISPLAY_COUNT,
74-
DEFAULT_LOCALE,
75-
GITHUB_REPO_URL,
76-
LOCALES_CODES,
77-
RSS_DISPLAY_COUNT,
78-
} from "@/lib/constants"
79-
80-
import {
81-
Accordion,
82-
AccordionContent,
83-
AccordionItem,
84-
AccordionTrigger,
85-
} from "../../components/ui/accordion"
68+
import { GITHUB_REPO_URL } from "@/lib/constants"
8669

8770
import { useClipboard } from "@/hooks/useClipboard"
88-
import loadNamespaces from "@/i18n/loadNamespaces"
89-
import { fetchCommunityEvents } from "@/lib/api/calendarEvents"
90-
import { fetchEthPrice } from "@/lib/api/fetchEthPrice"
91-
import { fetchGrowThePie } from "@/lib/api/fetchGrowThePie"
92-
import { fetchAttestantPosts } from "@/lib/api/fetchPosts"
93-
import { fetchRSS } from "@/lib/api/fetchRSS"
94-
import { fetchTotalEthStaked } from "@/lib/api/fetchTotalEthStaked"
95-
import { fetchTotalValueLocked } from "@/lib/api/fetchTotalValueLocked"
9671
import EventFallback from "@/public/images/events/event-placeholder.png"
9772
import BuildersImage from "@/public/images/heroes/developers-hub-hero.jpg"
9873
import ActivityImage from "@/public/images/heroes/layer-2-hub-hero.jpg"
@@ -111,110 +86,17 @@ const Codeblock = lazy(() =>
11186

11287
const StatsBoxGrid = lazy(() => import("@/components/StatsBoxGrid"))
11388

114-
// API calls
115-
const fetchXmlBlogFeeds = async () => {
116-
return await fetchRSS(BLOG_FEEDS)
117-
}
118-
11989
type Props = BasePageProps & {
90+
calendar: CommunityEvent[]
12091
metricResults: AllMetricData
12192
rssData: { rssItems: RSSItem[]; blogLinks: CommunityBlog[] }
12293
}
12394

124-
// In seconds
125-
const REVALIDATE_TIME = BASE_TIME_UNIT * 1
126-
127-
const loadData = dataLoader(
128-
[
129-
["ethPrice", fetchEthPrice],
130-
["totalEthStaked", fetchTotalEthStaked],
131-
["totalValueLocked", fetchTotalValueLocked],
132-
["growThePieData", fetchGrowThePie],
133-
["communityEvents", fetchCommunityEvents],
134-
["attestantPosts", fetchAttestantPosts],
135-
["rssData", fetchXmlBlogFeeds],
136-
],
137-
REVALIDATE_TIME * 1000
138-
)
139-
140-
export async function getStaticPaths() {
141-
return {
142-
paths: LOCALES_CODES.map((locale) => ({ params: { locale } })),
143-
fallback: false,
144-
}
145-
}
146-
147-
export const getStaticProps = (async ({ params }) => {
148-
const { locale = DEFAULT_LOCALE } = params || {}
149-
150-
const [
151-
ethPrice,
152-
totalEthStaked,
153-
totalValueLocked,
154-
growThePieData,
155-
communityEvents,
156-
attestantPosts,
157-
xmlBlogs,
158-
] = await loadData()
159-
160-
const metricResults: AllMetricData = {
161-
ethPrice,
162-
totalEthStaked,
163-
totalValueLocked,
164-
txCount: growThePieData.txCount,
165-
txCostsMedianUsd: growThePieData.txCostsMedianUsd,
166-
}
167-
168-
const calendar = communityEvents.upcomingEventData
169-
.sort((a, b) => {
170-
const dateA = isValidDate(a.date) ? new Date(a.date).getTime() : -Infinity
171-
const dateB = isValidDate(b.date) ? new Date(b.date).getTime() : -Infinity
172-
return dateA - dateB
173-
})
174-
.slice(0, CALENDAR_DISPLAY_COUNT)
175-
176-
// load i18n required namespaces for the given page
177-
const requiredNamespaces = getRequiredNamespacesForPage("/")
178-
179-
// check if the translated page content file exists for locale
180-
const contentNotTranslated = !existsNamespace(locale!, requiredNamespaces[0])
181-
182-
// load last deploy date to pass to Footer in RootLayout
183-
const lastDeployDate = getLastDeployDate()
184-
const lastDeployLocaleTimestamp = getLocaleTimestamp(
185-
locale as Lang,
186-
lastDeployDate
187-
)
188-
189-
// RSS feed items
190-
const polishedRssItems = polishRSSList(attestantPosts, ...xmlBlogs)
191-
const rssItems = polishedRssItems.slice(0, RSS_DISPLAY_COUNT)
192-
193-
const blogLinks = polishedRssItems.map(({ source, sourceUrl }) => ({
194-
name: source,
195-
href: sourceUrl,
196-
})) as CommunityBlog[]
197-
blogLinks.push(...BLOGS_WITHOUT_FEED)
198-
199-
const messages = await loadNamespaces(locale, requiredNamespaces)
200-
201-
return {
202-
props: {
203-
messages,
204-
calendar,
205-
contentNotTranslated,
206-
lastDeployLocaleTimestamp,
207-
metricResults,
208-
rssData: { rssItems, blogLinks },
209-
},
210-
}
211-
}) satisfies GetStaticProps<Props, Params>
212-
21395
const HomePage = ({
21496
calendar,
21597
metricResults,
21698
rssData: { rssItems, blogLinks },
217-
}: InferGetStaticPropsType<typeof getStaticProps>) => {
99+
}: Props) => {
218100
const {
219101
t,
220102
locale,
@@ -236,11 +118,18 @@ const HomePage = ({
236118

237119
return (
238120
<MainArticle className="flex w-full flex-col items-center" dir={dir}>
239-
<PageMetadata
240-
title={t("page-index:page-index-meta-title")}
241-
description={t("page-index:page-index-meta-description")}
242-
/>
243-
<TranslatathonBanner />
121+
<BannerNotification shouldShow>
122+
<p>
123+
Let&apos;s celebrate 10 years of Ethereum! How did ethereum change
124+
your life? -{" "}
125+
<Link
126+
href="https://ethereumstory.paperform.co/"
127+
className="text-white"
128+
>
129+
share your story
130+
</Link>
131+
</p>
132+
</BannerNotification>
244133
<HomeHero heroImg={Hero} className="w-full" />
245134
<div className="w-full space-y-32 px-4 md:mx-6 lg:space-y-48">
246135
<div className="my-20 grid w-full grid-cols-2 gap-x-4 gap-y-8 md:grid-cols-4 md:gap-x-10">
@@ -509,7 +398,7 @@ const HomePage = ({
509398
<button
510399
key={title}
511400
className={cn(
512-
"flex flex-col gap-y-0.5 border-t px-6 py-4 text-start hover:bg-background-highlight max-md:hidden",
401+
"flex flex-col gap-y-0.5 border-t px-6 py-4 hover:bg-background-highlight max-md:hidden",
513402
isModalOpen &&
514403
idx === activeCode &&
515404
"bg-background-highlight"

0 commit comments

Comments
 (0)