Skip to content

Commit 418cbdd

Browse files
committed
Merge branch 'dev' into fade-icons-find-wallet
2 parents f728a69 + d0ae81a commit 418cbdd

File tree

270 files changed

+9575
-1838
lines changed

Some content is hidden

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

270 files changed

+9575
-1838
lines changed

.all-contributorsrc

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7767,7 +7767,8 @@
77677767
"avatar_url": "https://avatars.githubusercontent.com/u/98348072?v=4",
77687768
"profile": "https://www.linkedin.com/in/lcalixxto/",
77697769
"contributions": [
7770-
"doc"
7770+
"doc",
7771+
"content"
77717772
]
77727773
},
77737774
{
@@ -8288,7 +8289,8 @@
82888289
"avatar_url": "https://avatars.githubusercontent.com/u/39565075?v=4",
82898290
"profile": "http://www.samuelakinosho.com",
82908291
"contributions": [
8291-
"doc"
8292+
"doc",
8293+
"code"
82928294
]
82938295
},
82948296
{
@@ -8374,6 +8376,92 @@
83748376
"contributions": [
83758377
"doc"
83768378
]
8379+
},
8380+
{
8381+
"login": "Aldizh",
8382+
"name": "Aldi Zhupani",
8383+
"avatar_url": "https://avatars.githubusercontent.com/u/2282120?v=4",
8384+
"profile": "http://aldizh.github.io/",
8385+
"contributions": [
8386+
"bug",
8387+
"code"
8388+
]
8389+
},
8390+
{
8391+
"login": "linhuatan",
8392+
"name": "linhuatan",
8393+
"avatar_url": "https://avatars.githubusercontent.com/u/94831627?v=4",
8394+
"profile": "https://github.com/linhuatan",
8395+
"contributions": [
8396+
"doc"
8397+
]
8398+
},
8399+
{
8400+
"login": "hughcrt",
8401+
"name": "Hugh",
8402+
"avatar_url": "https://avatars.githubusercontent.com/u/24587702?v=4",
8403+
"profile": "http://hugh.sh",
8404+
"contributions": [
8405+
"doc"
8406+
]
8407+
},
8408+
{
8409+
"login": "z3zzz",
8410+
"name": "Kim Kwangtae",
8411+
"avatar_url": "https://avatars.githubusercontent.com/u/91174156?v=4",
8412+
"profile": "https://github.com/z3zzz",
8413+
"contributions": [
8414+
"content"
8415+
]
8416+
},
8417+
{
8418+
"login": "tobi4021",
8419+
"name": "tobi4021",
8420+
"avatar_url": "https://avatars.githubusercontent.com/u/84390698?v=4",
8421+
"profile": "https://github.com/tobi4021",
8422+
"contributions": [
8423+
"doc"
8424+
]
8425+
},
8426+
{
8427+
"login": "lonelyotter",
8428+
"name": "Haochen Song",
8429+
"avatar_url": "https://avatars.githubusercontent.com/u/57280827?v=4",
8430+
"profile": "https://github.com/lonelyotter",
8431+
"contributions": [
8432+
"doc",
8433+
"translation"
8434+
]
8435+
},
8436+
{
8437+
"login": "opensourcex123",
8438+
"name": "N Fx",
8439+
"avatar_url": "https://avatars.githubusercontent.com/u/73230562?v=4",
8440+
"profile": "https://github.com/opensourcex123",
8441+
"contributions": [
8442+
"doc",
8443+
"translation"
8444+
]
8445+
},
8446+
{
8447+
"login": "srhinee",
8448+
"name": "samsara",
8449+
"avatar_url": "https://avatars.githubusercontent.com/u/29331203?v=4",
8450+
"profile": "https://github.com/srhinee",
8451+
"contributions": [
8452+
"doc",
8453+
"bug",
8454+
"translation"
8455+
]
8456+
},
8457+
{
8458+
"login": "greefea",
8459+
"name": "greefea",
8460+
"avatar_url": "https://avatars.githubusercontent.com/u/106492500?v=4",
8461+
"profile": "https://github.com/greefea",
8462+
"contributions": [
8463+
"doc"
8464+
]
83778465
}
83788466
],
83798467
"contributorsPerLine": 7,

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
12521252
<td align="center"><a href="https://www.youtube.com/c/Cryptoversidad"><img src="https://avatars.githubusercontent.com/u/107050863?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cryptoversidad</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=cryptoversidad" title="Documentation">📖</a></td>
12531253
<td align="center"><a href="https://disconnect3d.pl/"><img src="https://avatars.githubusercontent.com/u/10009354?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Disconnect3d</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=disconnect3d" title="Documentation">📖</a> <a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Adisconnect3d" title="Bug reports">🐛</a></td>
12541254
<td align="center"><a href="http://setharielgreen.com"><img src="https://avatars.githubusercontent.com/u/9850322?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Seth Ariel Green</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=setgree" title="Documentation">📖</a></td>
1255-
<td align="center"><a href="https://www.linkedin.com/in/lcalixxto/"><img src="https://avatars.githubusercontent.com/u/98348072?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luisa Calixto</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=lcalixxto" title="Documentation">📖</a></td>
1255+
<td align="center"><a href="https://www.linkedin.com/in/lcalixxto/"><img src="https://avatars.githubusercontent.com/u/98348072?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luisa Calixto</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=lcalixxto" title="Documentation">📖</a> <a href="#content-lcalixxto" title="Content">🖋</a></td>
12561256
</tr>
12571257
<tr>
12581258
<td align="center"><a href="https://github.com/theanneli"><img src="https://avatars.githubusercontent.com/u/106612248?v=4?s=100" width="100px;" alt=""/><br /><sub><b>theanneli</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=theanneli" title="Documentation">📖</a></td>
@@ -1324,7 +1324,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
13241324
<td align="center"><a href="https://github.com/gorondan"><img src="https://avatars.githubusercontent.com/u/97026899?v=4?s=100" width="100px;" alt=""/><br /><sub><b>gorondan</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=gorondan" title="Documentation">📖</a></td>
13251325
<td align="center"><a href="https://github.com/pruthvirajjadhav1"><img src="https://avatars.githubusercontent.com/u/73253354?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pruthviraj Jadhav</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=pruthvirajjadhav1" title="Documentation">📖</a></td>
13261326
<td align="center"><a href="https://gndx.io"><img src="https://avatars.githubusercontent.com/u/10554486?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Oscar Barajas Tavares</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=gndx" title="Documentation">📖</a></td>
1327-
<td align="center"><a href="http://www.samuelakinosho.com"><img src="https://avatars.githubusercontent.com/u/39565075?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Samuel Akinosho</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=LucidSamuel" title="Documentation">📖</a></td>
1327+
<td align="center"><a href="http://www.samuelakinosho.com"><img src="https://avatars.githubusercontent.com/u/39565075?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Samuel Akinosho</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=LucidSamuel" title="Documentation">📖</a> <a href="https://github.com/ethereum/ethereum-org-website/commits?author=LucidSamuel" title="Code">💻</a></td>
13281328
</tr>
13291329
<tr>
13301330
<td align="center"><a href="https://odair.dev"><img src="https://avatars.githubusercontent.com/u/45074733?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Odair Augusto Trujillo Orozco</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=OdairTrujillo" title="Documentation">📖</a> <a href="#ideas-OdairTrujillo" title="Ideas, Planning, & Feedback">🤔</a></td>
@@ -1338,6 +1338,17 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
13381338
<tr>
13391339
<td align="center"><a href="https://github.com/rogueassasin1729"><img src="https://avatars.githubusercontent.com/u/92800000?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rogueassasin1729</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=rogueassasin1729" title="Documentation">📖</a></td>
13401340
<td align="center"><a href="https://pandapip1.com/"><img src="https://avatars.githubusercontent.com/u/45835846?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pandapip1</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Pandapip1" title="Documentation">📖</a></td>
1341+
<td align="center"><a href="http://aldizh.github.io/"><img src="https://avatars.githubusercontent.com/u/2282120?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aldi Zhupani</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AAldizh" title="Bug reports">🐛</a> <a href="https://github.com/ethereum/ethereum-org-website/commits?author=Aldizh" title="Code">💻</a></td>
1342+
<td align="center"><a href="https://github.com/linhuatan"><img src="https://avatars.githubusercontent.com/u/94831627?v=4?s=100" width="100px;" alt=""/><br /><sub><b>linhuatan</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=linhuatan" title="Documentation">📖</a></td>
1343+
<td align="center"><a href="http://hugh.sh"><img src="https://avatars.githubusercontent.com/u/24587702?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Hugh</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=hughcrt" title="Documentation">📖</a></td>
1344+
<td align="center"><a href="https://github.com/z3zzz"><img src="https://avatars.githubusercontent.com/u/91174156?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kim Kwangtae</b></sub></a><br /><a href="#content-z3zzz" title="Content">🖋</a></td>
1345+
<td align="center"><a href="https://github.com/tobi4021"><img src="https://avatars.githubusercontent.com/u/84390698?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tobi4021</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=tobi4021" title="Documentation">📖</a></td>
1346+
</tr>
1347+
<tr>
1348+
<td align="center"><a href="https://github.com/lonelyotter"><img src="https://avatars.githubusercontent.com/u/57280827?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Haochen Song</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=lonelyotter" title="Documentation">📖</a> <a href="#translation-lonelyotter" title="Translation">🌍</a></td>
1349+
<td align="center"><a href="https://github.com/opensourcex123"><img src="https://avatars.githubusercontent.com/u/73230562?v=4?s=100" width="100px;" alt=""/><br /><sub><b>N Fx</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=opensourcex123" title="Documentation">📖</a> <a href="#translation-opensourcex123" title="Translation">🌍</a></td>
1350+
<td align="center"><a href="https://github.com/srhinee"><img src="https://avatars.githubusercontent.com/u/29331203?v=4?s=100" width="100px;" alt=""/><br /><sub><b>samsara</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=srhinee" title="Documentation">📖</a> <a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Asrhinee" title="Bug reports">🐛</a> <a href="#translation-srhinee" title="Translation">🌍</a></td>
1351+
<td align="center"><a href="https://github.com/greefea"><img src="https://avatars.githubusercontent.com/u/106492500?v=4?s=100" width="100px;" alt=""/><br /><sub><b>greefea</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=greefea" title="Documentation">📖</a></td>
13411352
</tr>
13421353
</table>
13431354

docs/chakra-migration-guide.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Chakra migration guide
2+
3+
This is a reference for migrating our current `styled` components from `emotion` to [Chakra](https://chakra-ui.com/) components.
4+
5+
This is part of our [UI library implementation epic](https://github.com/ethereum/ethereum-org-website/issues/6374).
6+
7+
## Replace styled components with Chakra components
8+
9+
All `styled` components need to be removed and replaced with the corresponded Chakra component. [See the list of components](https://chakra-ui.com/docs/components).
10+
11+
## Override styles using style props
12+
13+
- You can see how to use the different style props here: [https://chakra-ui.com/docs/styled-system/style-props](https://chakra-ui.com/docs/styled-system/style-props#margin-and-padding)
14+
- Chakra default values are documented here: [https://chakra-ui.com/docs/styled-system/theme](https://chakra-ui.com/docs/styled-system/theme)
15+
16+
```tsx
17+
// before
18+
const Paragraph = styled.p`
19+
font-size: 1rem;
20+
margin: 1rem;
21+
`
22+
23+
// now
24+
<Text fontSize="md" margin={4} />
25+
```
26+
27+
## Theme colors
28+
29+
All the previous colors defined in the old theme `src/theme.ts` were ported into the new theme as well. Use the same color variables.
30+
31+
```tsx
32+
// before
33+
const Text = styled.p`
34+
color: ${({ theme }) => theme.colors.primary};
35+
background-color: ${({ theme }) => theme.colors.background};
36+
`
37+
38+
// now
39+
<Text color="primary" bg="background" />
40+
```
41+
42+
<aside>
43+
💡 In the **next iteration** we will refactor all the colors with the correct color from the new Design System
44+
</aside>
45+
46+
## Update dependencies
47+
48+
- [Deprecated] `src/components/Icon` - use the [Chakra Icon](https://chakra-ui.com/docs/components/icon/usage) instead.
49+
50+
```tsx
51+
import { Icon } from "@chakra-ui/react"
52+
import { BsQuestionSquareFill } from "react-icons/bs"
53+
;<Icon as={BsQuestionSquareFill} />
54+
```
55+
56+
- [Deprecated]`src/components/SharedStyledComponents` - we are not using this anymore, use Chakra components instead.
57+
58+
## Do you have any other question?
59+
60+
Ping us in Discord, in the `#ui-library-migration` channel, or leave a comment here or in your opened PR, and we can help you out 💪

docs/typescript.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ When we reach the moment where the entire codebase is in TS, we will enable `noI
99

1010
This is just starting, any suggestion is always welcomed and appreciated.
1111

12+
## Declaring types for variables
13+
14+
When declaring types for variables, you should only declare a type when it isn't obvious and the type can't be inferred.
15+
16+
```
17+
// Do not use
18+
const someVar: string = 'string'
19+
20+
// Use
21+
const someVar = 'string'
22+
```
23+
24+
Do declare a type for an unassigned variable when a type can not be inferred.
25+
26+
```
27+
const someVar: string
28+
```
29+
1230
## Migration guide & contribution opportunity 🎉
1331

1432
We'd love your help in migrating our codebase!

gatsby-node.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,11 @@ export const onPostBootstrap: GatsbyNode["onPostBootstrap"] = ({ actions }) => {
435435
}
436436

437437
export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"] =
438-
({ actions, schema }) => {
438+
({ actions }) => {
439439
const { createTypes } = actions
440-
const { sdls, builders } = Schema
440+
const { sdls } = Schema
441441

442-
createTypes([
443-
...Object.keys(sdls).map((sdlKey) => sdls[sdlKey]),
444-
schema.buildObjectType(builders.WalletsCsv),
445-
])
442+
createTypes([...Object.keys(sdls).map((sdlKey) => sdls[sdlKey])])
446443
}
447444

448445
export const onPreBootstrap: GatsbyNode["onPreBootstrap"] = ({ reporter }) => {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "4.11.1",
3+
"version": "5.1.2",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "git@github.com:ethereum/ethereum-org-website.git",
@@ -30,12 +30,12 @@
3030
"framer-motion": "^6.5.1",
3131
"gatsby": "^4.15.0",
3232
"gatsby-plugin-emotion": "^7.19.0",
33-
"gatsby-plugin-gatsby-cloud": "^4.3.0",
33+
"gatsby-plugin-gatsby-cloud": "^4.20.0",
3434
"gatsby-plugin-image": "^2.0.0",
3535
"gatsby-plugin-manifest": "^4.10.1",
3636
"gatsby-plugin-matomo": "^0.9.0",
3737
"gatsby-plugin-mdx": "^2.14.1",
38-
"gatsby-plugin-netlify": "^3.14.0",
38+
"gatsby-plugin-netlify": "^5.0.1",
3939
"gatsby-plugin-react-helmet": "^5.0.0",
4040
"gatsby-plugin-react-helmet-canonical-urls": "^1.4.0",
4141
"gatsby-plugin-react-svg": "^3.1.0",
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
export type Colors = typeof colors
22

3-
const colors = {}
3+
const colors = {
4+
grey: {
5+
100: "#f7f7f7",
6+
300: "#d4d4d4",
7+
500: "#646464",
8+
700: "#222222",
9+
900: "#141414",
10+
},
11+
blue: {
12+
100: "#e8e8ff",
13+
300: "#8d8dff",
14+
500: "#1c1cff",
15+
700: "#0b0b66",
16+
},
17+
orange: {
18+
100: "#ffe3d3",
19+
300: "#ffb991",
20+
500: "#ff7324",
21+
800: "#451900",
22+
},
23+
red: {
24+
600: "#b80000",
25+
},
26+
green: {
27+
500: "#109e62",
28+
},
29+
yellow: {
30+
200: "#fff8df",
31+
},
32+
}
433

534
export default colors
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import {
2+
lightTheme as oldLightTheme,
3+
darkTheme as oldDarkTheme,
4+
} from "../../theme"
5+
6+
const oldLightThemeColors = oldLightTheme.colors
7+
const oldDarkThemeColors = oldDarkTheme.colors
8+
9+
// define each of the old colors as a `semanticToken`:
10+
// `name: { _light: lightColor, _dark: darkColor }`
11+
const oldColors = Object.keys(oldLightThemeColors).reduce((colors, color) => {
12+
const lightColor = oldLightThemeColors[color]
13+
const darkColor = oldDarkThemeColors[color]
14+
15+
if (typeof lightColor !== "string" || typeof darkColor !== "string") {
16+
return colors
17+
}
18+
19+
return {
20+
...colors,
21+
[color]: { _light: lightColor, _dark: darkColor },
22+
}
23+
}, {})
24+
25+
const semanticTokens = {
26+
colors: {
27+
// define old colors from the old theme as semanticTokens to transition
28+
// from emotion components to chakra
29+
// TODO: remove these colors as we migrate away from them
30+
...oldColors,
31+
32+
// Design System colors
33+
primary: { _light: "blue.500", _dark: "orange.500" },
34+
primaryDark: { _light: "blue.700", _dark: "orange.800" },
35+
primaryHover: { _light: "blue.300", _dark: "orange.300" },
36+
primaryLight: { _light: "blue.100", _dark: "orange.100" },
37+
body: { _light: "grey.700", _dark: "grey.100" },
38+
bodyLight: { _light: "grey.500", _dark: "grey.100" },
39+
disabled: { _light: "grey.300", _dark: "grey.500" },
40+
background: { _light: "white", _dark: "grey.700" },
41+
success: "green.500",
42+
error: "red.600",
43+
attention: "yellow.200",
44+
},
45+
}
46+
47+
export default semanticTokens

src/@chakra-ui/gatsby-plugin/theme.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import styles from "./styles"
1010
// Foundational style overrides
1111
import foundations from "./foundations"
1212

13+
import semanticTokens from "./semanticTokens"
14+
1315
const config: ThemeConfig = {
1416
cssVarPrefix: "eth",
1517
initialColorMode: "light",
@@ -20,6 +22,7 @@ const theme: ThemeOverride = {
2022
config,
2123
styles,
2224
...foundations,
25+
semanticTokens,
2326
}
2427

2528
export default extendTheme(theme)

src/components/AssetDownload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const AssetDownload: React.FC<IProps> = ({
105105
{children && <ImageContainer>{children}</ImageContainer>}
106106
{!children && (
107107
<ImageContainer>
108-
{!!Svg ? (
108+
{Svg ? (
109109
<Svg alt={alt} />
110110
) : (
111111
<Image image={getImage(image)} alt={alt} />

0 commit comments

Comments
 (0)