Skip to content

Commit 252096f

Browse files
authored
Merge pull request #11554 from ethereum/dev
Release candidate v7.23.1
2 parents 4248d78 + 445ddf0 commit 252096f

File tree

94 files changed

+1792
-855
lines changed

Some content is hidden

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

94 files changed

+1792
-855
lines changed

.all-contributorsrc

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8379,7 +8379,8 @@
83798379
"avatar_url": "https://avatars.githubusercontent.com/u/45835846?v=4",
83808380
"profile": "https://pandapip1.com/",
83818381
"contributions": [
8382-
"doc"
8382+
"doc",
8383+
"ideas"
83838384
]
83848385
},
83858386
{
@@ -10676,6 +10677,42 @@
1067610677
"contributions": [
1067710678
"doc"
1067810679
]
10680+
},
10681+
{
10682+
"login": "joaolago1113",
10683+
"name": "joao",
10684+
"avatar_url": "https://avatars.githubusercontent.com/u/22820692?v=4",
10685+
"profile": "https://github.com/joaolago1113",
10686+
"contributions": [
10687+
"doc"
10688+
]
10689+
},
10690+
{
10691+
"login": "rgb2hsl",
10692+
"name": "Eugene",
10693+
"avatar_url": "https://avatars.githubusercontent.com/u/3310192?v=4",
10694+
"profile": "http://p2p.org",
10695+
"contributions": [
10696+
"content"
10697+
]
10698+
},
10699+
{
10700+
"login": "g0rbe",
10701+
"name": "Dániel Görbe",
10702+
"avatar_url": "https://avatars.githubusercontent.com/u/36860942?v=4",
10703+
"profile": "http://www.danielgorbe.com",
10704+
"contributions": [
10705+
"doc"
10706+
]
10707+
},
10708+
{
10709+
"login": "s-crypt",
10710+
"name": "s-crypt",
10711+
"avatar_url": "https://avatars.githubusercontent.com/u/41712656?v=4",
10712+
"profile": "https://blog.insubli.me",
10713+
"contributions": [
10714+
"content"
10715+
]
1067910716
}
1068010717
],
1068110718
"contributorsPerLine": 7,

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# These owners will be the default owners for everything in
77
# the repo. Unless a later match takes precedence,
8-
* @samajammin @wackerow @corwintines @pettinarip @minimalsm @jmcook1186 @nhsz
8+
* @wackerow @corwintines @pettinarip @minimalsm @nhsz
99

1010
# Owners of specific files
1111
/src/data/consensus-bounty-hunters.csv @djrtwo @asanso @fredriksvantes

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
13471347
</tr>
13481348
<tr>
13491349
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rogueassasin1729"><img src="https://avatars.githubusercontent.com/u/92800000?v=4?s=100" width="100px;" alt="rogueassasin1729"/><br /><sub><b>rogueassasin1729</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=rogueassasin1729" title="Documentation">📖</a></td>
1350-
<td align="center" valign="top" width="14.28%"><a href="https://pandapip1.com/"><img src="https://avatars.githubusercontent.com/u/45835846?v=4?s=100" width="100px;" alt="Pandapip1"/><br /><sub><b>Pandapip1</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Pandapip1" title="Documentation">📖</a></td>
1350+
<td align="center" valign="top" width="14.28%"><a href="https://pandapip1.com/"><img src="https://avatars.githubusercontent.com/u/45835846?v=4?s=100" width="100px;" alt="Pandapip1"/><br /><sub><b>Pandapip1</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Pandapip1" title="Documentation">📖</a> <a href="#ideas-Pandapip1" title="Ideas, Planning, & Feedback">🤔</a></td>
13511351
<td align="center" valign="top" width="14.28%"><a href="http://aldizh.github.io/"><img src="https://avatars.githubusercontent.com/u/2282120?v=4?s=100" width="100px;" alt="Aldi Zhupani"/><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>
13521352
<td align="center" valign="top" width="14.28%"><a href="https://github.com/linhuatan"><img src="https://avatars.githubusercontent.com/u/94831627?v=4?s=100" width="100px;" alt="linhuatan"/><br /><sub><b>linhuatan</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=linhuatan" title="Documentation">📖</a></td>
13531353
<td align="center" valign="top" width="14.28%"><a href="http://hugh.sh"><img src="https://avatars.githubusercontent.com/u/24587702?v=4?s=100" width="100px;" alt="Hugh"/><br /><sub><b>Hugh</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=hughcrt" title="Documentation">📖</a></td>
@@ -1671,6 +1671,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
16711671
</tr>
16721672
<tr>
16731673
<td align="center" valign="top" width="14.28%"><a href="https://github.com/costgallo"><img src="https://avatars.githubusercontent.com/u/49433698?v=4?s=100" width="100px;" alt="Costanza"/><br /><sub><b>Costanza</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=costgallo" title="Documentation">📖</a></td>
1674+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/joaolago1113"><img src="https://avatars.githubusercontent.com/u/22820692?v=4?s=100" width="100px;" alt="joao"/><br /><sub><b>joao</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=joaolago1113" title="Documentation">📖</a></td>
1675+
<td align="center" valign="top" width="14.28%"><a href="http://p2p.org"><img src="https://avatars.githubusercontent.com/u/3310192?v=4?s=100" width="100px;" alt="Eugene"/><br /><sub><b>Eugene</b></sub></a><br /><a href="#content-rgb2hsl" title="Content">🖋</a></td>
1676+
<td align="center" valign="top" width="14.28%"><a href="http://www.danielgorbe.com"><img src="https://avatars.githubusercontent.com/u/36860942?v=4?s=100" width="100px;" alt="Dániel Görbe"/><br /><sub><b>Dániel Görbe</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=g0rbe" title="Documentation">📖</a></td>
1677+
<td align="center" valign="top" width="14.28%"><a href="https://blog.insubli.me"><img src="https://avatars.githubusercontent.com/u/41712656?v=4?s=100" width="100px;" alt="s-crypt"/><br /><sub><b>s-crypt</b></sub></a><br /><a href="#content-s-crypt" title="Content">🖋</a></td>
16741678
</tr>
16751679
</tbody>
16761680
</table>

gatsby-node.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const commonRedirectProps = {
3838
* @returns boolean for if file is outdated or not
3939
*/
4040
const checkIsMdxOutdated = (filePath: string): boolean => {
41-
const dirname = path.resolve("./")
41+
// .replace(/\\/g, "/") to replace \ in windows paths ex: C:\\folder\\myfile.txt becomes C:/folder/myfile.txt
42+
const dirname = path.resolve("./").replace(/\\/g, "/")
4243
const splitPath = filePath.split(dirname)
4344
const tempSplitPath = splitPath[1]
4445
const tempSplit = tempSplitPath.split("/")

src/assets/heroes/community-hero.png

1.86 MB
Loading

src/components/Quiz/QuizItem.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const QuizItem: React.FC<QuizzesListItem> = (props) => {
5656
<Flex gap={2} alignItems="center">
5757
<Text
5858
color={isCompleted ? "body.medium" : "text"}
59-
fontWeight="bold"
6059
_before={{
6160
content: 'counter(list-counter) ". "',
6261
}}
@@ -65,9 +64,7 @@ const QuizItem: React.FC<QuizzesListItem> = (props) => {
6564
</Text>
6665

6766
{/* Show green tick if quizz was completed only */}
68-
<Box display={isCompleted ? "flex" : "none"}>
69-
<GreenTickIcon />
70-
</Box>
67+
{isCompleted && <GreenTickIcon />}
7168
</Flex>
7269

7370
{/* Labels */}
@@ -86,7 +83,7 @@ const QuizItem: React.FC<QuizzesListItem> = (props) => {
8683
{/* Start Button */}
8784
<Box w={{ base: "full", lg: "auto" }}>
8885
<Button
89-
variant="outline-color"
86+
variant="outline"
9087
w={{ base: "full", lg: "auto" }}
9188
onClick={handleStart}
9289
>

src/components/Quiz/QuizRadioGroup.tsx

Lines changed: 96 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import {
44
chakra,
55
Circle,
66
Flex,
7+
FlexProps,
78
RadioProps,
9+
SquareProps,
10+
Stack,
811
Text,
12+
TextProps,
913
useRadio,
1014
useRadioGroup,
1115
useToken,
@@ -21,6 +25,90 @@ import { Question } from "../../types"
2125
interface CustomRadioProps extends RadioProps {
2226
index: number
2327
label: string
28+
showAnswer: boolean
29+
isSelectedCorrect: boolean
30+
}
31+
32+
const CustomRadio: React.FC<CustomRadioProps> = ({
33+
index,
34+
label,
35+
showAnswer,
36+
isSelectedCorrect,
37+
...radioProps
38+
}) => {
39+
const { state, getInputProps, getRadioProps, htmlProps } =
40+
useRadio(radioProps)
41+
42+
// Memoized values
43+
const buttonBg = useMemo<string>(() => {
44+
if (!state.isChecked) return "body.inverted"
45+
if (!showAnswer) return "primary.base"
46+
if (!isSelectedCorrect) return "error.base"
47+
return "success.base"
48+
}, [state.isChecked, showAnswer, isSelectedCorrect])
49+
50+
const primaryBaseColor = useToken("colors", "primary.base")
51+
52+
const focusProps: FlexProps = {
53+
outline: showAnswer ? "none" : `1px solid ${primaryBaseColor}`,
54+
}
55+
56+
const controlFocusProps: SquareProps = {
57+
bg: showAnswer ? "white" : "primary.pressed",
58+
}
59+
60+
const getRadioControlBg = (): SquareProps["bg"] => {
61+
if (showAnswer) return "white"
62+
63+
if (state.isChecked) return "primary.pressed"
64+
65+
return "disabled"
66+
}
67+
68+
const getControlLabelColor = (): TextProps["color"] => {
69+
if (!showAnswer) return "white"
70+
71+
if (isSelectedCorrect) return "success.base"
72+
73+
return "error.base"
74+
}
75+
76+
// Render CustomRadio component
77+
return (
78+
<chakra.label {...htmlProps} cursor="pointer" w="100%">
79+
<input {...getInputProps()} />
80+
<Flex
81+
{...getRadioProps()}
82+
w="100%"
83+
p={2}
84+
alignItems="center"
85+
bg={buttonBg}
86+
color={state.isChecked ? "white" : "text"}
87+
borderRadius="base"
88+
_hover={{ ...focusProps, cursor: showAnswer ? "default" : "pointer" }}
89+
_focus={focusProps}
90+
data-group
91+
>
92+
<Circle
93+
size="25px"
94+
bg={getRadioControlBg()}
95+
_groupHover={controlFocusProps}
96+
_groupFocus={controlFocusProps}
97+
me={2}
98+
>
99+
<Text
100+
m="0"
101+
fontWeight="700"
102+
fontSize="lg"
103+
color={getControlLabelColor()}
104+
>
105+
{String.fromCharCode(97 + index).toUpperCase()}
106+
</Text>
107+
</Circle>
108+
{label}
109+
</Flex>
110+
</chakra.label>
111+
)
24112
}
25113

26114
interface IProps {
@@ -52,91 +140,18 @@ const QuizRadioGroup: React.FC<IProps> = ({
52140
[selectedAnswer]
53141
)
54142

55-
// Custom radio button component
56-
const CustomRadio: React.FC<CustomRadioProps> = ({
57-
index,
58-
label,
59-
...radioProps
60-
}) => {
61-
const { state, getInputProps, getCheckboxProps, htmlProps } =
62-
useRadio(radioProps)
63-
64-
// Memoized values
65-
const buttonBg = useMemo<string>(() => {
66-
if (!state.isChecked) return "body.inverted"
67-
if (!showAnswer) return "primary.base"
68-
if (!isSelectedCorrect) return "error.base"
69-
return "success.base"
70-
}, [state.isChecked, showAnswer, isSelectedCorrect])
71-
72-
const primaryBaseColor = useToken("colors", "primary.base")
73-
74-
// Render CustomRadio component
75-
return (
76-
<chakra.label {...htmlProps} cursor="pointer" data-group w="100%">
77-
<input {...getInputProps({})} hidden />
78-
<Flex
79-
{...getCheckboxProps()}
80-
w="100%"
81-
p={2}
82-
alignItems="center"
83-
bg={buttonBg}
84-
color={state.isChecked ? "white" : "text"}
85-
borderRadius="base"
86-
_hover={{
87-
boxShadow: showAnswer ? "none" : "primary.base",
88-
outline: showAnswer ? "none" : `1px solid ${primaryBaseColor}`,
89-
cursor: showAnswer ? "default" : "pointer",
90-
}}
91-
>
92-
<Circle
93-
size="25px"
94-
bg={
95-
showAnswer
96-
? "white"
97-
: state.isChecked
98-
? "primary.pressed"
99-
: "disabled"
100-
}
101-
_groupHover={{
102-
bg: showAnswer ? "white" : "primary.pressed",
103-
}}
104-
me={2}
105-
>
106-
<Text
107-
m="0"
108-
fontWeight="700"
109-
fontSize="lg"
110-
color={
111-
!showAnswer
112-
? "white"
113-
: isSelectedCorrect
114-
? "success.base"
115-
: "error.base"
116-
}
117-
>
118-
{String.fromCharCode(97 + index).toUpperCase()}
119-
</Text>
120-
</Circle>
121-
{label}
122-
</Flex>
123-
</chakra.label>
124-
)
125-
}
126-
127143
// Render QuizRadioGroup
128144
return (
129-
<Flex {...getRootProps()} direction="column" w="100%">
145+
<Stack spacing="6" {...getRootProps()} w="100%">
130146
<Text
131147
textAlign={{ base: "center", md: "left" }}
132148
fontWeight="700"
133-
fontSize="2xl"
134-
mb={6}
149+
size="2xl"
135150
>
136151
{t(prompt)}
137152
</Text>
138153

139-
<Flex direction="column" gap={4}>
154+
<Stack gap="4">
140155
{answers.map(({ id, label }, index) => {
141156
const display =
142157
!showAnswer || id === selectedAnswer ? "inline-flex" : "none"
@@ -146,21 +161,23 @@ const QuizRadioGroup: React.FC<IProps> = ({
146161
display={display}
147162
index={index}
148163
label={t(label)}
164+
showAnswer={showAnswer}
165+
isSelectedCorrect={isSelectedCorrect}
149166
{...getRadioProps({ value: id })}
150167
/>
151168
)
152169
})}
153-
</Flex>
170+
</Stack>
154171

155172
{showAnswer && (
156-
<Box mt={5}>
173+
<Box>
157174
<Text fontWeight="bold" mt={0} mb={2}>
158175
<Translation id="explanation" />
159176
</Text>
160177
<Text m={0}>{t(explanation)}</Text>
161178
</Box>
162179
)}
163-
</Flex>
180+
</Stack>
164181
)
165182
}
166183

0 commit comments

Comments
 (0)