Skip to content

Commit 1f064bc

Browse files
committed
Merge branch 'dev' into layout-algolia
2 parents 1714616 + 9adfeab commit 1f064bc

File tree

153 files changed

+3316
-2135
lines changed

Some content is hidden

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

153 files changed

+3316
-2135
lines changed

.env.example

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
# rename this file to .env and supply the values listed below
22
# also make sure they are available to the build tool (e.g. Netlify)
3-
# warning: variables prefixed with GATSBY_ will be made available to client-side code
3+
# warning: variables prefixed with NEXT_PUBLIC_ will be made available to client-side code
44
# be careful not to expose sensitive data (e.g. your Algolia admin key)
5-
# ALGOLIA_ADMIN_KEY=insertValue
5+
6+
# Algolia environment (app ID, search key and base search index name required for search)
7+
# NEXT_PUBLIC_ALGOLIA_APP_ID=insertValue
8+
# NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=insertValue
9+
# NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME=insertValue
10+
# NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY=insertValue
11+
12+
# Etherscan API key (required for Etherscan API fetches)
613
# ETHERSCAN_API_KEY=insertValue
7-
# GATSBY_ALGOLIA_APP_ID=insertValue
8-
# GATSBY_ALGOLIA_SEARCH_KEY=insertValue
9-
# GATSBY_ALGOLIA_BASE_SEARCH_INDEX_NAME=insertValue
10-
NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY=insertValue
11-
# GATSBY_FUNCTIONS_PATH=insertValue
1214

13-
# Folders or files to ignore from the `public/content` folder
14-
IGNORE_CONTENT=**/docs,**/tutorials
15+
# Google API key and Calendar ID (required to fetch Calendar events)
16+
# GOOGLE_API_KEY=
17+
# GOOGLE_CALENDAR_ID=
18+
19+
# Matomo environment (URL and site ID required for analytics)
20+
NEXT_PUBLIC_MATOMO_URL=
21+
NEXT_PUBLIC_MATOMO_SITE_ID=
1522

1623
# Used to avoid loading Matomo in our preview deploys
1724
IS_PREVIEW_DEPLOY=false
@@ -21,6 +28,6 @@ IS_PREVIEW_DEPLOY=false
2128
# Note: always include `en` as it is the default lang of the site
2229
BUILD_LOCALES=
2330

24-
# If resource constraints are being hit during builds, change LIMIT_CPU to `true`
25-
# to limit the demand during build time
26-
LIMIT_CPU=false
31+
# If resource constraints are being hit during builds, change LIMIT_CPUS to a
32+
# fixed number of CPUs (e.g. 2) to limit the demand during build time
33+
LIMIT_CPUS=

netlify.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
[functions]
2121
included_files = [
22-
"!./src/data/**/*",
22+
"./src/intl/**/*",
2323
"!./public/**/*",
24-
24+
"!./node_modules/@swc/core-linux-x64-musl/**/*",
2525
]

next.config.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ const { PHASE_DEVELOPMENT_SERVER } = require("next/constants")
22

33
const { i18n } = require("./next-i18next.config")
44

5-
const experimental =
6-
(process.env.LIMIT_CPU || "").toLowerCase() === "true"
7-
? {
8-
// This option could be enabled in the future when flagged as stable, to speed up builds
9-
// (see https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)
10-
// mdxRs: true,
11-
12-
// Reduce the number of cpus and disable parallel threads in prod envs to consume less memory
13-
workerThreads: false,
14-
cpus: 2,
15-
}
16-
: {}
5+
const LIMIT_CPUS = Number(process.env.LIMIT_CPUS || 2)
6+
7+
const experimental = LIMIT_CPUS
8+
? {
9+
// This option could be enabled in the future when flagged as stable, to speed up builds
10+
// (see https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)
11+
// mdxRs: true,
12+
13+
// Reduce the number of cpus and disable parallel threads in prod envs to consume less memory
14+
workerThreads: false,
15+
cpus: LIMIT_CPUS,
16+
}
17+
: {}
1718

1819
/** @type {import('next').NextConfig} */
1920
module.exports = (phase, { defaultConfig }) => {

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"@docsearch/react": "^3.5.2",
2222
"@emotion/react": "^11.11.1",
2323
"@emotion/styled": "^11.11.0",
24+
"@socialgouv/matomo-next": "^1.8.0",
2425
"clipboard": "^2.0.11",
26+
"embla-carousel-react": "^7.0.0",
2527
"ethereum-blockies-base64": "^1.0.2",
2628
"focus-trap-react": "^10.2.3",
2729
"framer-motion": "^10.13.0",
@@ -31,7 +33,7 @@
3133
"lodash.merge": "^4.6.2",
3234
"lodash.shuffle": "^4.2.0",
3335
"luxon": "^3.4.3",
34-
"next": "^14.0.0",
36+
"next": "13.4.8",
3537
"next-i18next": "^14.0.3",
3638
"next-mdx-remote": "^3.0.8",
3739
"next-sitemap": "^4.2.3",
@@ -51,7 +53,7 @@
5153
},
5254
"devDependencies": {
5355
"@chakra-ui/storybook-addon": "5.1.0",
54-
"@netlify/plugin-nextjs": "^4.40.2",
56+
"@netlify/plugin-nextjs": "^4.41.3",
5557
"@storybook/addon-essentials": "7.5.3",
5658
"@storybook/addon-interactions": "7.5.3",
5759
"@storybook/addon-links": "7.5.3",
@@ -66,7 +68,7 @@
6668
"@types/react": "^18.2.15",
6769
"@types/react-dom": "^18.2.7",
6870
"eslint": "^8.45.0",
69-
"eslint-config-next": "^14.0.0",
71+
"eslint-config-next": "^13.0.0",
7072
"eslint-config-prettier": "^9.0.0",
7173
"eslint-plugin-simple-import-sort": "^10.0.0",
7274
"eslint-plugin-storybook": "^0.6.15",

public/_redirects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/en/ / 301!
2+
13
/discord https://discord.gg/ethereum-org 301!
24

35
/*/discord https://discord.gg/ethereum-org 301!

src/components/ActionCard.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { StaticImageData } from "next/image"
12
import type { ReactNode } from "react"
23
import {
34
Box,
@@ -10,7 +11,7 @@ import {
1011
useColorModeValue,
1112
} from "@chakra-ui/react"
1213

13-
import { Image, type ImageProps } from "@/components/Image"
14+
import { Image } from "@/components/Image"
1415
import { BaseLink } from "@/components/Link"
1516
import Text from "@/components/OldText"
1617

@@ -30,7 +31,8 @@ export type ActionCardProps = Omit<LinkBoxProps, "title"> & {
3031
children?: ReactNode
3132
to: string
3233
alt?: string
33-
image: ImageProps["src"]
34+
image: StaticImageData
35+
imageWidth?: number
3436
title: ReactNode
3537
description?: ReactNode
3638
className?: string
@@ -42,6 +44,7 @@ const ActionCard = ({
4244
to,
4345
alt,
4446
image,
47+
imageWidth = 220,
4548
title,
4649
description,
4750
children,
@@ -76,7 +79,8 @@ const ActionCard = ({
7679
>
7780
<Image
7881
src={image}
79-
width={220}
82+
width={imageWidth}
83+
maxH="full"
8084
alt={alt || ""}
8185
style={{ objectFit: "cover" }}
8286
/>

src/components/AdoptionChart.tsx

Lines changed: 58 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,53 @@
1-
// Libraries
2-
import React, { ReactNode } from "react"
3-
import { Box, BoxProps, Flex, useColorMode } from "@chakra-ui/react"
1+
import { useTranslation } from "next-i18next"
2+
import { Box, type BoxProps, Flex, useColorMode } from "@chakra-ui/react"
43

5-
// Components
6-
import Translation from "./Translation"
4+
import type { ChildOnlyProp } from "@/lib/types"
75

8-
const Column: React.FC<{ children: ReactNode }> = ({ children }) => {
9-
return (
10-
<Flex
11-
flexDirection="column-reverse"
12-
ms={{ base: 2, md: 4 }}
13-
_first={{ ms: 0 }}
14-
>
15-
{children}
16-
</Flex>
17-
)
18-
}
6+
const Column = ({ children }: ChildOnlyProp) => (
7+
<Flex
8+
flexDirection="column-reverse"
9+
ms={{ base: 2, md: 4 }}
10+
_first={{ ms: 0 }}
11+
>
12+
{children}
13+
</Flex>
14+
)
1915

20-
const Cell: React.FC<BoxProps> = ({ children, color, ...props }) => {
21-
return (
22-
<Box
23-
border="1px solid"
24-
borderColor={color || "text"}
25-
color={color || "text"}
26-
py="0.8rem"
27-
px={{ base: 2, md: "1.2rem" }}
28-
fontSize="0.9rem"
29-
fontWeight="bold"
30-
lineHeight="none"
31-
textAlign="center"
32-
_last={{
33-
borderTopStartRadius: "2xl",
34-
borderTopEndRadius: "2xl",
35-
}}
36-
sx={{
37-
"&:nth-child(-n + 2)": {
38-
borderBottomStartRadius: "2xl",
39-
borderBottomEndRadius: "2xl",
40-
},
41-
}}
42-
{...props}
43-
>
44-
{children}
45-
</Box>
46-
)
47-
}
48-
49-
const ColumnName: React.FC<{ children: ReactNode }> = ({ children }) => {
50-
return (
51-
<Cell border="none" pt={6}>
52-
{children}
53-
</Cell>
54-
)
55-
}
16+
const Cell = ({ children, color, ...props }: BoxProps) => (
17+
<Box
18+
border="1px solid"
19+
borderColor={color || "text"}
20+
color={color || "text"}
21+
py="0.8rem"
22+
px={{ base: 2, md: "1.2rem" }}
23+
fontSize="0.9rem"
24+
fontWeight="bold"
25+
lineHeight="none"
26+
textAlign="center"
27+
_last={{
28+
borderTopStartRadius: "2xl",
29+
borderTopEndRadius: "2xl",
30+
}}
31+
sx={{
32+
"&:nth-child(-n + 2)": {
33+
borderBottomStartRadius: "2xl",
34+
borderBottomEndRadius: "2xl",
35+
},
36+
}}
37+
{...props}
38+
>
39+
{children}
40+
</Box>
41+
)
5642

57-
interface IProps {}
43+
const ColumnName = ({ children }: ChildOnlyProp) => (
44+
<Cell border="none" pt={6}>
45+
{children}
46+
</Cell>
47+
)
5848

59-
const AdoptionChart: React.FC<IProps> = () => {
49+
const AdoptionChart = () => {
50+
const { t } = useTranslation("page-what-is-ethereum")
6051
const { colorMode } = useColorMode()
6152
const isDark = colorMode === "dark"
6253

@@ -65,50 +56,48 @@ const AdoptionChart: React.FC<IProps> = () => {
6556
<Column>
6657
<ColumnName>2010</ColumnName>
6758
<Cell color={isDark ? "#FBF9A5" : "#95935B"}>
68-
<Translation id="adoption-chart-investors-label" />
59+
{t("adoption-chart-investors-label")}
6960
</Cell>
7061
</Column>
7162

7263
<Column>
7364
<ColumnName>2014</ColumnName>
7465
<Cell color={isDark ? "#FBF9A5" : "#95935B"}>
75-
<Translation id="adoption-chart-investors-label" />
66+
{t("adoption-chart-investors-label")}
7667
</Cell>
7768
<Cell color={isDark ? "#9EC885" : "#67954C"}>
78-
<Translation id="adoption-chart-developers-label" />
69+
{t("adoption-chart-developers-label")}
7970
</Cell>
8071
<Cell color={isDark ? "#E78F6E" : "#CB7C5E"}>
81-
<Translation id="adoption-chart-companies-label" />
72+
{t("adoption-chart-companies-label")}
8273
</Cell>
8374
</Column>
8475

8576
<Column>
86-
<ColumnName>
87-
<Translation id="adoption-chart-column-now-label" />
88-
</ColumnName>
77+
<ColumnName>{t("adoption-chart-column-now-label")}</ColumnName>
8978
<Cell color={isDark ? "#FBF9A5" : "#95935B"}>
90-
<Translation id="adoption-chart-investors-label" />
79+
{t("adoption-chart-investors-label")}
9180
</Cell>
9281
<Cell color={isDark ? "#9EC885" : "#67954C"}>
93-
<Translation id="adoption-chart-developers-label" />
82+
{t("adoption-chart-developers-label")}
9483
</Cell>
9584
<Cell color={isDark ? "#E78F6E" : "#CB7C5E"}>
96-
<Translation id="adoption-chart-companies-label" />
85+
{t("adoption-chart-companies-label")}
9786
</Cell>
9887
<Cell color={isDark ? "#8EA8CA" : "#5E7492"}>
99-
<Translation id="adoption-chart-artists-label" />
88+
{t("adoption-chart-artists-label")}
10089
</Cell>
10190
<Cell color={isDark ? "#AC85C2" : "#88669B"}>
102-
<Translation id="adoption-chart-musicians-label" />
91+
{t("adoption-chart-musicians-label")}
10392
</Cell>
10493
<Cell color={isDark ? "#CA928E" : "#985955"}>
105-
<Translation id="adoption-chart-writers-label" />
94+
{t("adoption-chart-writers-label")}
10695
</Cell>
10796
<Cell color={isDark ? "#B9B9B9" : "#9E9E9E"}>
108-
<Translation id="adoption-chart-gamers-label" />
97+
{t("adoption-chart-gamers-label")}
10998
</Cell>
11099
<Cell color={isDark ? "#E2B79E" : "#E78A54"}>
111-
<Translation id="adoption-chart-refugees-label" />
100+
{t("adoption-chart-refugees-label")}
112101
</Cell>
113102
</Column>
114103
</Flex>

src/components/BaseStories/Heading.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const Heading: Story = {
8585
textAlign="end"
8686
size={obj.size}
8787
>
88-
{obj.size || "xl"}
88+
{obj.size as string|| "xl"}
8989
</HeadingComponent>
9090
<HeadingComponent flex="3" {...obj}>
9191
{args.children}

src/components/BaseStories/Text.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
} from "@chakra-ui/react"
1111
import { Meta, StoryObj } from "@storybook/react"
1212

13-
import components from "../../@chakra-ui/gatsby-plugin/components"
13+
import components from "@/@chakra-ui/components"
14+
1415
import Translation from "../Translation"
1516

1617
type TextType = typeof Text

0 commit comments

Comments
 (0)