Skip to content

Commit 127e8f2

Browse files
committed
Merge branch 'dev' of github.com:ethereum/ethereum-org-website into find-wallet-revamp
2 parents 273e745 + 22e6161 commit 127e8f2

File tree

14 files changed

+164
-113
lines changed

14 files changed

+164
-113
lines changed

.all-contributorsrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11296,6 +11296,69 @@
1129611296
"contributions": [
1129711297
"content"
1129811298
]
11299+
},
11300+
{
11301+
"login": "sixhobbits",
11302+
"name": "Gareth Dwyer",
11303+
"avatar_url": "https://avatars.githubusercontent.com/u/2641205?v=4",
11304+
"profile": "https://dwyer.co.za",
11305+
"contributions": [
11306+
"ideas"
11307+
]
11308+
},
11309+
{
11310+
"login": "UNOFFICIALbgd",
11311+
"name": "UNOFFICIALbgd",
11312+
"avatar_url": "https://avatars.githubusercontent.com/u/71248977?v=4",
11313+
"profile": "https://github.com/UNOFFICIALbgd",
11314+
"contributions": [
11315+
"bug"
11316+
]
11317+
},
11318+
{
11319+
"login": "Codex-Bugmenot",
11320+
"name": "Codex-Bugmenot",
11321+
"avatar_url": "https://avatars.githubusercontent.com/u/59927099?v=4",
11322+
"profile": "https://github.com/Codex-Bugmenot",
11323+
"contributions": [
11324+
"bug"
11325+
]
11326+
},
11327+
{
11328+
"login": "doutv",
11329+
"name": "Jason Huang",
11330+
"avatar_url": "https://avatars.githubusercontent.com/u/20609724?v=4",
11331+
"profile": "http://huangyongjin.com",
11332+
"contributions": [
11333+
"bug"
11334+
]
11335+
},
11336+
{
11337+
"login": "adeolu98",
11338+
"name": "dCRYPT",
11339+
"avatar_url": "https://avatars.githubusercontent.com/u/39372980?v=4",
11340+
"profile": "https://github.com/adeolu98",
11341+
"contributions": [
11342+
"bug"
11343+
]
11344+
},
11345+
{
11346+
"login": "sourabupadhya123",
11347+
"name": "Sourab",
11348+
"avatar_url": "https://avatars.githubusercontent.com/u/64914231?v=4",
11349+
"profile": "https://github.com/sourabupadhya123",
11350+
"contributions": [
11351+
"security"
11352+
]
11353+
},
11354+
{
11355+
"login": "ykaravas",
11356+
"name": "ykaravas",
11357+
"avatar_url": "https://avatars.githubusercontent.com/u/6537956?v=4",
11358+
"profile": "https://github.com/ykaravas",
11359+
"contributions": [
11360+
"bug"
11361+
]
1129911362
}
1130011363
],
1130111364
"contributorsPerLine": 7,

.github/workflows/get-crowdin-contributors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ jobs:
5959
6060
- name: Create Pull Request
6161
run: |
62-
gh auth login --with-token <<< ${{ secrets.GITHUB_TOKEN }}
62+
gh auth login --with-token ${{ secrets.GITHUB_TOKEN }}
6363
gh pr create --base dev --head "automated-update-${{ env.TIMESTAMP }}" --title "Update translation contributors from Crowdin - ${{ env.READABLE_DATE }}" --body-file pr_body.txt

.github/workflows/get-translation-progress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ jobs:
6060
6161
- name: Create Pull Request
6262
run: |
63-
gh auth login --with-token <<< ${{ secrets.GITHUB_TOKEN }}
63+
gh auth login --with-token ${{ secrets.GITHUB_TOKEN }}
6464
gh pr create --base dev --head "automated-update-${{ env.TIMESTAMP }}" --title "Update translation progress from Crowdin - ${{ env.READABLE_DATE }}" --body-file pr_body.txt

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,15 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
17571757
<td align="center" valign="top" width="14.28%"><a href="https://github.com/acceptacross"><img src="https://avatars.githubusercontent.com/u/150119116?v=4?s=100" width="100px;" alt="acceptacross"/><br /><sub><b>acceptacross</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=acceptacross" title="Documentation">📖</a></td>
17581758
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pdelagrave"><img src="https://avatars.githubusercontent.com/u/17990895?v=4?s=100" width="100px;" alt="Pierre Delagrave"/><br /><sub><b>Pierre Delagrave</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Apdelagrave" title="Bug reports">🐛</a></td>
17591759
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@blainemalone01"><img src="https://avatars.githubusercontent.com/u/15608778?v=4?s=100" width="100px;" alt="Blaine Malone"/><br /><sub><b>Blaine Malone</b></sub></a><br /><a href="#content-blmalone" title="Content">🖋</a></td>
1760+
<td align="center" valign="top" width="14.28%"><a href="https://dwyer.co.za"><img src="https://avatars.githubusercontent.com/u/2641205?v=4?s=100" width="100px;" alt="Gareth Dwyer"/><br /><sub><b>Gareth Dwyer</b></sub></a><br /><a href="#ideas-sixhobbits" title="Ideas, Planning, & Feedback">🤔</a></td>
1761+
</tr>
1762+
<tr>
1763+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/UNOFFICIALbgd"><img src="https://avatars.githubusercontent.com/u/71248977?v=4?s=100" width="100px;" alt="UNOFFICIALbgd"/><br /><sub><b>UNOFFICIALbgd</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AUNOFFICIALbgd" title="Bug reports">🐛</a></td>
1764+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Codex-Bugmenot"><img src="https://avatars.githubusercontent.com/u/59927099?v=4?s=100" width="100px;" alt="Codex-Bugmenot"/><br /><sub><b>Codex-Bugmenot</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3ACodex-Bugmenot" title="Bug reports">🐛</a></td>
1765+
<td align="center" valign="top" width="14.28%"><a href="http://huangyongjin.com"><img src="https://avatars.githubusercontent.com/u/20609724?v=4?s=100" width="100px;" alt="Jason Huang"/><br /><sub><b>Jason Huang</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Adoutv" title="Bug reports">🐛</a></td>
1766+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/adeolu98"><img src="https://avatars.githubusercontent.com/u/39372980?v=4?s=100" width="100px;" alt="dCRYPT"/><br /><sub><b>dCRYPT</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aadeolu98" title="Bug reports">🐛</a></td>
1767+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sourabupadhya123"><img src="https://avatars.githubusercontent.com/u/64914231?v=4?s=100" width="100px;" alt="Sourab"/><br /><sub><b>Sourab</b></sub></a><br /><a href="#security-sourabupadhya123" title="Security">🛡️</a></td>
1768+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ykaravas"><img src="https://avatars.githubusercontent.com/u/6537956?v=4?s=100" width="100px;" alt="ykaravas"/><br /><sub><b>ykaravas</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aykaravas" title="Bug reports">🐛</a></td>
17601769
</tr>
17611770
</tbody>
17621771
</table>

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"i18next": "^23.6.0",
3838
"lodash.merge": "^4.6.2",
3939
"lodash.shuffle": "^4.2.0",
40-
"luxon": "^3.4.3",
4140
"next": "13.4.8",
4241
"next-i18next": "^14.0.3",
4342
"next-mdx-remote": "^3.0.8",
@@ -67,7 +66,6 @@
6766
"@storybook/testing-library": "0.2.2",
6867
"@svgr/webpack": "^8.1.0",
6968
"@types/hast": "^3.0.0",
70-
"@types/luxon": "^3.3.2",
7169
"@types/node": "^20.4.2",
7270
"@types/react": "^18.2.15",
7371
"@types/react-dom": "^18.2.7",

src/components/CommunityEvents/index.tsx

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { DateTime, DateTimeFormatOptions } from "luxon"
21
import { useRouter } from "next/router"
32
import { useTranslation } from "next-i18next"
43
import { FaDiscord } from "react-icons/fa"
@@ -12,6 +11,7 @@ import {
1211
Icon,
1312
} from "@chakra-ui/react"
1413

14+
import type { Lang } from "@/lib/types"
1515
import type { CommunityEvent } from "@/lib/interfaces"
1616

1717
import { ButtonLink } from "@/components/Buttons"
@@ -21,6 +21,7 @@ import Text from "@/components/OldText"
2121
import Translation from "@/components/Translation"
2222

2323
import { trackCustomEvent } from "@/lib/utils/matomo"
24+
import { getLocaleTimestamp } from "@/lib/utils/time"
2425

2526
const matomoEvent = (buttonType: string) => {
2627
trackCustomEvent({
@@ -30,30 +31,15 @@ const matomoEvent = (buttonType: string) => {
3031
})
3132
}
3233

33-
const renderEventDateTime = (
34-
date: string,
35-
language: string,
36-
params: DateTimeFormatOptions = {
37-
year: "numeric",
38-
month: "long",
39-
day: "numeric",
40-
hour12: false,
41-
hour: "numeric",
42-
minute: "numeric",
43-
}
44-
) => {
45-
return DateTime.fromISO(date).setLocale(language).toLocaleString(params)
46-
}
47-
48-
interface EventProps {
34+
type EventProps = {
4935
event: CommunityEvent
50-
language: string
5136
type: "upcoming" | "past"
5237
}
5338

54-
const Event = ({ event, language, type }: EventProps) => {
39+
const Event = ({ event, type }: EventProps) => {
40+
const { locale } = useRouter()
5541
const { date, title, calendarLink } = event
56-
const params: DateTimeFormatOptions = {
42+
const options: Intl.DateTimeFormatOptions = {
5743
year: "numeric",
5844
month: "short",
5945
day: "numeric",
@@ -63,7 +49,7 @@ const Event = ({ event, language, type }: EventProps) => {
6349
<Grid gap={6} templateColumns="auto 1fr" mb={4}>
6450
<GridItem>
6551
<Text color="body.medium" m={0}>
66-
{renderEventDateTime(date, language, params)}
52+
{getLocaleTimestamp(locale! as Lang, date, options)}
6753
</Text>
6854
</GridItem>
6955
<GridItem>
@@ -130,9 +116,17 @@ const CommunityEvents = ({ events }: CommunityEventsProps) => {
130116
{reversedUpcomingEventData[0].title}
131117
</Text>
132118
<Text m={0} fontSize="xl">
133-
{renderEventDateTime(
119+
{getLocaleTimestamp(
120+
locale! as Lang,
134121
reversedUpcomingEventData[0].date,
135-
locale!
122+
{
123+
year: "numeric",
124+
month: "long",
125+
day: "numeric",
126+
hour12: false,
127+
hour: "numeric",
128+
minute: "numeric",
129+
}
136130
)}
137131
</Text>
138132
<Text color="body.medium" fontSize="md">
@@ -177,14 +171,7 @@ const CommunityEvents = ({ events }: CommunityEventsProps) => {
177171
<Divider mb={4} />
178172
{reversedUpcomingEventData.slice(1).length ? (
179173
reversedUpcomingEventData.slice(1).map((item, idx) => {
180-
return (
181-
<Event
182-
key={idx}
183-
event={item}
184-
language={locale!}
185-
type="upcoming"
186-
/>
187-
)
174+
return <Event key={idx} event={item} type="upcoming" />
188175
})
189176
) : (
190177
<Text mx="auto">
@@ -197,9 +184,7 @@ const CommunityEvents = ({ events }: CommunityEventsProps) => {
197184
<Divider mb={4} />
198185
{reversedPastEventData.length ? (
199186
reversedPastEventData.map((item, idx) => {
200-
return (
201-
<Event key={idx} event={item} language={locale!} type="past" />
202-
)
187+
return <Event key={idx} event={item} type="past" />
203188
})
204189
) : (
205190
<Text mx="auto">

src/components/Footer.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,12 @@ const Footer = ({ lastDeployDate }: FooterProps) => {
338338
alignItems="center"
339339
flexWrap="wrap"
340340
>
341-
<Box color="text200">
342-
<Translation id="website-last-updated" />:{" "}
343-
{getLocaleTimestamp(locale as Lang, lastDeployDate!)}
344-
</Box>
341+
{lastDeployDate && (
342+
<Box color="text200">
343+
<Translation id="website-last-updated" />:{" "}
344+
{getLocaleTimestamp(locale as Lang, lastDeployDate)}
345+
</Box>
346+
)}
345347
<Box my={4}>
346348
{socialLinks.map(({ to, ariaLabel, icon, color }) => (
347349
<BaseLink

src/layouts/Docs.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,18 @@ export const docsComponents = {
206206
YouTube,
207207
}
208208

209-
interface DocsLayoutProps
210-
extends Pick<
211-
MdPageContent,
212-
| "slug"
213-
| "tocItems"
214-
| "lastUpdatedDate"
215-
| "crowdinContributors"
216-
| "contentNotTranslated"
217-
>,
218-
ChildOnlyProp {
219-
frontmatter: DocsFrontmatter
220-
}
209+
type DocsLayoutProps = Pick<
210+
MdPageContent,
211+
| "slug"
212+
| "tocItems"
213+
| "lastUpdatedDate"
214+
| "crowdinContributors"
215+
| "contentNotTranslated"
216+
> &
217+
Required<Pick<MdPageContent, "lastUpdatedDate">> &
218+
ChildOnlyProp & {
219+
frontmatter: DocsFrontmatter
220+
}
221221

222222
export const DocsLayout = ({
223223
children,
@@ -233,7 +233,8 @@ export const DocsLayout = ({
233233
const absoluteEditPath = getEditPath(relativePath)
234234

235235
const gitHubLastEdit = useClientSideGitHubLastEdit(relativePath)
236-
const intlLastEdit = "data" in gitHubLastEdit ? gitHubLastEdit.data! : ""
236+
const intlLastEdit =
237+
"data" in gitHubLastEdit ? gitHubLastEdit.data : lastUpdatedDate
237238
const useGitHubContributors =
238239
frontmatter.lang === DEFAULT_LOCALE || crowdinContributors.length === 0
239240

@@ -252,7 +253,7 @@ export const DocsLayout = ({
252253
{useGitHubContributors ? (
253254
<GitHubContributors
254255
relativePath={relativePath}
255-
lastUpdatedDate={lastUpdatedDate!}
256+
lastUpdatedDate={lastUpdatedDate}
256257
/>
257258
) : (
258259
<CrowdinContributors

src/layouts/Static.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ export const StaticLayout = ({
118118
) : (
119119
<>
120120
<Breadcrumbs slug={slug} mb="8" />
121-
<Text
122-
color="text200"
123-
dir={isLangRightToLeft(locale as Lang) ? "rtl" : "ltr"}
124-
>
125-
<Translation id="page-last-updated" />:{" "}
126-
{getLocaleTimestamp(locale as Lang, lastUpdatedDate!)}
127-
</Text>
121+
{lastUpdatedDate && (
122+
<Text
123+
color="text200"
124+
dir={isLangRightToLeft(locale as Lang) ? "rtl" : "ltr"}
125+
>
126+
<Translation id="page-last-updated" />:{" "}
127+
{getLocaleTimestamp(locale as Lang, lastUpdatedDate)}
128+
</Text>
129+
)}
128130
</>
129131
)}
130132

src/layouts/Tutorial.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,15 @@ export const tutorialsComponents = {
165165
StyledDivider,
166166
YouTube,
167167
}
168-
interface TutorialLayoutProps
169-
extends ChildOnlyProp,
170-
Pick<
171-
MdPageContent,
172-
| "tocItems"
173-
| "lastUpdatedDate"
174-
| "crowdinContributors"
175-
| "contentNotTranslated"
176-
> {
177-
frontmatter: TutorialFrontmatter
178-
timeToRead: number
179-
}
168+
type TutorialLayoutProps = ChildOnlyProp &
169+
Pick<
170+
MdPageContent,
171+
"tocItems" | "crowdinContributors" | "contentNotTranslated"
172+
> &
173+
Required<Pick<MdPageContent, "lastUpdatedDate">> & {
174+
frontmatter: TutorialFrontmatter
175+
timeToRead: number
176+
}
180177

181178
export const TutorialLayout = ({
182179
children,
@@ -194,7 +191,8 @@ export const TutorialLayout = ({
194191
const postMergeBannerTranslationString =
195192
frontmatter.postMergeBannerTranslation as TranslationKey | null
196193
const gitHubLastEdit = useClientSideGitHubLastEdit(relativePath)
197-
const intlLastEdit = "data" in gitHubLastEdit ? gitHubLastEdit.data! : ""
194+
const intlLastEdit =
195+
"data" in gitHubLastEdit ? gitHubLastEdit.data! : lastUpdatedDate
198196
const useGitHubContributors =
199197
frontmatter.lang === DEFAULT_LOCALE || crowdinContributors.length === 0
200198

@@ -226,7 +224,7 @@ export const TutorialLayout = ({
226224
{useGitHubContributors ? (
227225
<GitHubContributors
228226
relativePath={relativePath}
229-
lastUpdatedDate={lastUpdatedDate!}
227+
lastUpdatedDate={lastUpdatedDate}
230228
/>
231229
) : (
232230
<CrowdinContributors

0 commit comments

Comments
 (0)