Skip to content

Commit c29bcab

Browse files
authored
Merge pull request #10852 from ethereum/staging
Deploy v7.18.0
2 parents cac63af + 3aa9c2e commit c29bcab

File tree

53 files changed

+710
-435
lines changed

Some content is hidden

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

53 files changed

+710
-435
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10366,6 +10366,24 @@
1036610366
"contributions": [
1036710367
"content"
1036810368
]
10369+
},
10370+
{
10371+
"login": "TucksonDev",
10372+
"name": "Tuckson",
10373+
"avatar_url": "https://avatars.githubusercontent.com/u/105675159?v=4",
10374+
"profile": "https://github.com/TucksonDev",
10375+
"contributions": [
10376+
"content"
10377+
]
10378+
},
10379+
{
10380+
"login": "Akamig",
10381+
"name": "Akamig",
10382+
"avatar_url": "https://avatars.githubusercontent.com/u/6278999?v=4",
10383+
"profile": "https://twitter.com/_Akamig",
10384+
"contributions": [
10385+
"content"
10386+
]
1036910387
}
1037010388
],
1037110389
"contributorsPerLine": 7,

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
16221622
<tr>
16231623
<td align="center" valign="top" width="14.28%"><a href="https://surajanand88.github.io/portfolio/"><img src="https://avatars.githubusercontent.com/u/120190623?v=4?s=100" width="100px;" alt="Suraj Anand"/><br /><sub><b>Suraj Anand</b></sub></a><br /><a href="#content-SurajAnand88" title="Content">🖋</a></td>
16241624
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MwitahJob"><img src="https://avatars.githubusercontent.com/u/136892656?v=4?s=100" width="100px;" alt="Mwitah "/><br /><sub><b>Mwitah </b></sub></a><br /><a href="#content-MwitahJob" title="Content">🖋</a></td>
1625+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TucksonDev"><img src="https://avatars.githubusercontent.com/u/105675159?v=4?s=100" width="100px;" alt="Tuckson"/><br /><sub><b>Tuckson</b></sub></a><br /><a href="#content-TucksonDev" title="Content">🖋</a></td>
1626+
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/_Akamig"><img src="https://avatars.githubusercontent.com/u/6278999?v=4?s=100" width="100px;" alt="Akamig"/><br /><sub><b>Akamig</b></sub></a><br /><a href="#content-Akamig" title="Content">🖋</a></td>
16251627
</tr>
16261628
</tbody>
16271629
</table>

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "7.17.2",
3+
"version": "7.18.0",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "git@github.com:ethereum/ethereum-org-website.git",
@@ -123,10 +123,8 @@
123123
"scripts": {
124124
"postinstall": "yarn theme",
125125
"build": "gatsby build",
126-
"build:lambda": "NODE_OPTIONS=--openssl-legacy-provider netlify-lambda build src/lambda --config=./webpack.lambda.js",
127-
"build:10gb": "NODE_OPTIONS=--max-old-space-size=10240 gatsby build",
128-
"build:lambda-cross-env": "cross-env NODE_OPTIONS=--openssl-legacy-provider netlify-lambda build src/lambda --config=./webpack.lambda.js",
129-
"build:10gb-cross-env": "cross-env NODE_OPTIONS=--max-old-space-size=10240 gatsby build",
126+
"build:lambda": "cross-env NODE_OPTIONS=--openssl-legacy-provider netlify-lambda build src/lambda --config=./webpack.lambda.js",
127+
"build:10gb": "cross-env NODE_OPTIONS=--max-old-space-size=10240 gatsby build",
130128
"clean": "gatsby clean",
131129
"crowdin-clean": "rm -rf .crowdin && mkdir .crowdin",
132130
"crowdin-import": "ts-node src/scripts/crowdin-import.ts",

src/api/calendarEvents.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { GatsbyFunctionRequest, GatsbyFunctionResponse } from "gatsby"
2+
import { lambda } from "../lambda/calendarEvents"
3+
4+
async function handler(
5+
__req: GatsbyFunctionRequest,
6+
res: GatsbyFunctionResponse
7+
): Promise<void> {
8+
// passing env vars as arguments due to a bug on GC functions where env vars
9+
// can not be accessed by imported functions
10+
const { statusCode, body } = await lambda(
11+
process.env.GOOGLE_API_KEY!,
12+
process.env.GOOGLE_CALENDAR_ID!
13+
)
14+
res.status(statusCode).send(body)
15+
}
16+
17+
export default handler

src/assets/layer-2/arbitrum.png

56 KB
Loading
107 KB
Loading

src/assets/wallets/find-wallet.png

41 KB
Loading

src/components/Banners/DismissableBanner.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Center, CloseButton } from "@chakra-ui/react"
44

55
// Components
66
import BannerNotification from "../BannerNotification"
7-
import Emoji from "../Emoji"
87

98
// Interface
109
export interface IProps {
@@ -27,10 +26,7 @@ const DismissableBanner: React.FC<IProps> = ({ children, storageKey }) => {
2726

2827
return (
2928
<BannerNotification shouldShow={show}>
30-
<Center paddingEnd={8}>
31-
<Emoji marginEnd={4} flexShrink={0} text=":tada:" />
32-
{children}
33-
</Center>
29+
<Center paddingEnd={8}>{children}</Center>
3430
<CloseButton onClick={onClose} aria-label="Close Banner" />
3531
</BannerNotification>
3632
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react"
2+
import { Text } from "@chakra-ui/react"
3+
4+
import DismissableBanner from "./DismissableBanner"
5+
import Link from "../Link"
6+
7+
export const TranslatathonBanner = () => {
8+
return (
9+
<DismissableBanner storageKey="translatathon">
10+
<Text m={0}>
11+
✨ Join the first Ethereum.org Translatathon: help translate our website
12+
and compete for prizes in a hackathon-style online event.{" "}
13+
<Link to="/contributing/translation-program/translatathon">
14+
Apply until August 15th
15+
</Link>
16+
.
17+
</Text>
18+
</DismissableBanner>
19+
)
20+
}
21+
22+
export default TranslatathonBanner
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
//Libraries
2+
import React, { ComponentProps } from "react"
3+
import { useI18next, useTranslation } from "gatsby-plugin-react-i18next"
4+
import {
5+
Box,
6+
Center,
7+
Divider,
8+
Flex,
9+
Grid,
10+
GridItem,
11+
Heading,
12+
Icon,
13+
Text,
14+
} from "@chakra-ui/react"
15+
import { FaDiscord } from "react-icons/fa"
16+
import { DateTime, DateTimeFormatOptions } from "luxon"
17+
18+
// Components
19+
import ButtonLink from "../ButtonLink"
20+
import Link from "../Link"
21+
import Translation from "../Translation"
22+
23+
// Utils
24+
import { trackCustomEvent } from "../../utils/matomo"
25+
26+
// Hooks
27+
import {
28+
type Event as EventType,
29+
useCommunityEvents,
30+
} from "./useCommunityEvents"
31+
32+
const matomoEvent = (buttonType: string) => {
33+
trackCustomEvent({
34+
eventCategory: "CommunityEventsWidget",
35+
eventAction: "clicked",
36+
eventName: buttonType,
37+
})
38+
}
39+
40+
const renderEventDateTime = (
41+
date: string,
42+
language: string,
43+
params: DateTimeFormatOptions = {
44+
year: "numeric",
45+
month: "long",
46+
day: "numeric",
47+
hour12: false,
48+
hour: "numeric",
49+
minute: "numeric",
50+
}
51+
) => {
52+
return DateTime.fromISO(date).setLocale(language).toLocaleString(params)
53+
}
54+
55+
const EventLink = (props: ComponentProps<typeof Link>) => (
56+
<Link fontWeight="700" {...props} />
57+
)
58+
59+
interface EventProps {
60+
event: EventType
61+
language: string
62+
type: "upcoming" | "past"
63+
}
64+
65+
const Event = ({ event, language, type }: EventProps) => {
66+
const { date, title, calendarLink } = event
67+
const params: DateTimeFormatOptions = {
68+
year: "numeric",
69+
month: "short",
70+
day: "numeric",
71+
}
72+
73+
return (
74+
<Grid gap={6} templateColumns="auto 1fr">
75+
<GridItem>
76+
<Text>{renderEventDateTime(date, language, params)}</Text>
77+
</GridItem>
78+
<GridItem>
79+
<EventLink to={calendarLink} onClick={() => matomoEvent(type)}>
80+
{title}
81+
</EventLink>
82+
</GridItem>
83+
</Grid>
84+
)
85+
}
86+
87+
const CommunityEvents = () => {
88+
const { language } = useI18next()
89+
const { t } = useTranslation()
90+
const { pastEventData, upcomingEventData, loading, hasError } =
91+
useCommunityEvents()
92+
93+
return (
94+
<Flex
95+
w="full"
96+
flexDirection={{ base: "column", lg: "row" }}
97+
p={{
98+
base: "0",
99+
sm: "2rem 0 0",
100+
lg: "2rem 2rem 0",
101+
}}
102+
>
103+
<Center w={{ base: "100%", lg: "40%" }}>
104+
<Box pr={8} pl={{ base: 8, lg: 0 }}>
105+
<Heading>
106+
<Translation id="community-events-content-heading" />
107+
</Heading>
108+
<Text>
109+
<Translation id="community-events-content-1" />
110+
</Text>
111+
<Text>
112+
<Translation id="community-events-content-2" />
113+
</Text>
114+
</Box>
115+
</Center>
116+
<Flex
117+
w={{ base: "100%", lg: "60%" }}
118+
flexDirection={{ base: "column", lg: "row" }}
119+
>
120+
<Flex
121+
w={{ base: "100%", lg: "50%" }}
122+
bg="layer2Gradient"
123+
p={8}
124+
textAlign="center"
125+
flexDir="column"
126+
>
127+
<Text fontSize="md" fontWeight="bold">
128+
<Translation id="community-events-next-event" />
129+
</Text>
130+
{loading ? (
131+
<Text>
132+
<Translation id="loading" />
133+
</Text>
134+
) : (
135+
<Box>
136+
{hasError ? (
137+
<Text color="error">
138+
<Translation id="loading-error-try-again-later" />
139+
</Text>
140+
) : upcomingEventData.length ? (
141+
<>
142+
<Text m={0} fontSize="xl">
143+
{renderEventDateTime(upcomingEventData[0].date, language)}
144+
</Text>
145+
<Text color={"bodyLight"} fontSize="md">
146+
({Intl.DateTimeFormat().resolvedOptions().timeZone})
147+
</Text>
148+
<Text fontSize="3xl" fontWeight="bold" mb={10}>
149+
{upcomingEventData[0].title}
150+
</Text>
151+
</>
152+
) : (
153+
<Text fontSize="3xl" fontWeight="bold" mb={8}>
154+
<Translation id="community-events-no-events-planned" />
155+
</Text>
156+
)}
157+
<Flex flexDirection="column" gap={6}>
158+
<ButtonLink
159+
to="/discord/"
160+
gap={2}
161+
onClick={() => matomoEvent("discord")}
162+
>
163+
<Icon as={FaDiscord} fontSize={25} />
164+
Join Discord
165+
</ButtonLink>
166+
{upcomingEventData[0] && (
167+
<EventLink
168+
to={upcomingEventData[0].calendarLink}
169+
onClick={() => matomoEvent("Add to calendar")}
170+
>
171+
{t("community-events-add-to-calendar")}
172+
</EventLink>
173+
)}
174+
</Flex>
175+
</Box>
176+
)}
177+
</Flex>
178+
<Flex
179+
w={{ base: "100%", lg: "50%" }}
180+
bg="backgroundHighlight"
181+
p={8}
182+
flexDir="column"
183+
>
184+
<Text fontSize="lg" fontWeight="bold" mb={2}>
185+
<Translation id="community-events-upcoming-calls" />
186+
</Text>
187+
<Divider mb={4} />
188+
{loading ? (
189+
<Text>
190+
<Translation id="loading" />
191+
</Text>
192+
) : hasError ? (
193+
<Text color="error">
194+
<Translation id="loading-error-try-again-later" />
195+
</Text>
196+
) : upcomingEventData.slice(1).length ? (
197+
upcomingEventData.slice(1).map((item) => {
198+
return <Event event={item} language={language} type="upcoming" />
199+
})
200+
) : (
201+
<Text mx="auto">
202+
<Translation id="community-events-no-upcoming-calls" />
203+
</Text>
204+
)}
205+
<Text fontSize="lg" fontWeight="bold" mb={2}>
206+
<Translation id="community-events-previous-calls" />
207+
</Text>
208+
<Divider mb={4} />
209+
{loading ? (
210+
<Text>
211+
<Translation id="loading" />
212+
</Text>
213+
) : hasError ? (
214+
<Text color="error">
215+
<Translation id="loading-error-try-again-later" />
216+
</Text>
217+
) : pastEventData.length ? (
218+
pastEventData.map((item) => {
219+
return <Event event={item} language={language} type="past" />
220+
})
221+
) : (
222+
<Text mx="auto">
223+
<Translation id="community-events-there-are-no-past-calls" />
224+
</Text>
225+
)}
226+
</Flex>
227+
</Flex>
228+
</Flex>
229+
)
230+
}
231+
232+
export default CommunityEvents

0 commit comments

Comments
 (0)