Skip to content

Commit 62af72e

Browse files
authored
Merge pull request #10362 from ethereum/staging
Deploy v7.13.0
2 parents f7c68a6 + 6762f6b commit 62af72e

File tree

182 files changed

+1972
-748
lines changed

Some content is hidden

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

182 files changed

+1972
-748
lines changed

.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
"@storybook/addon-a11y",
1313
"@chakra-ui/storybook-addon",
1414
],
15+
staticDirs: ["../static"],
1516
babel: async (options) => ({
1617
...babelConfig,
1718
}),

.storybook/preview.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { action } from "@storybook/addon-actions"
22

33
import theme from "../src/@chakra-ui/gatsby-plugin/theme"
44

5+
import "../static/fonts/inter-font-face.css"
6+
import "../static/fonts/ibm-plex-font-face.css"
7+
58
const chakraBreakpointArray = Object.entries(theme.breakpoints)
69

710
// Gatsby's Link overrides:

gatsby-node.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ export const createPages: GatsbyNode<any, Context>["createPages"] = async ({
291291
isOutdated: false,
292292
isContentEnglish: true,
293293
relativePath, // Use English path for template MDX query
294+
isDefaultLang: lang === defaultLanguage,
294295
// gatsby i18n plugin
295296
i18n: {
296297
language: lang,
@@ -366,6 +367,7 @@ export const createPages: GatsbyNode<any, Context>["createPages"] = async ({
366367
slug,
367368
isContentEnglish,
368369
isOutdated,
370+
isDefaultLang: lang === defaultLanguage,
369371
// gatsby i18n plugin
370372
i18n: {
371373
language: lang,
@@ -391,6 +393,8 @@ export const onCreatePage: GatsbyNode<any, Context>["onCreatePage"] = async ({
391393
actions,
392394
}) => {
393395
const { createPage, deletePage, createRedirect } = actions
396+
const rootPath = page.path.slice(3)
397+
const is404Page = rootPath.match(/^\/404(\/|.html)$/)
394398

395399
if (!page.context) {
396400
return
@@ -417,9 +421,11 @@ export const onCreatePage: GatsbyNode<any, Context>["onCreatePage"] = async ({
417421
context: {
418422
...page.context,
419423
languagesToFetch: [language],
420-
isOutdated,
421-
//display TranslationBanner for translation-component pages that are still in English
424+
// hide the outdated content banner for 404 pages
425+
isOutdated: is404Page ? false : isOutdated,
426+
// display TranslationBanner for translation-component pages that are still in English
422427
isContentEnglish,
428+
isDefaultLang,
423429
},
424430
}
425431

@@ -445,8 +451,7 @@ export const onCreatePage: GatsbyNode<any, Context>["onCreatePage"] = async ({
445451
if (!IS_DEV && i18n.routed) {
446452
createPage<Context>(newPage)
447453

448-
const rootPath = page.path.slice(3)
449-
if (isDefaultLang && !rootPath.match(/^\/404(\/|.html)$/)) {
454+
if (isDefaultLang && !is404Page) {
450455
createRedirect({
451456
...commonRedirectProps,
452457
fromPath: rootPath,

gatsby-ssr.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,21 @@ export const onRenderBody = ({ setHeadComponents }: RenderBodyArgs) => {
1818
crossOrigin="anonymous"
1919
key="interFont"
2020
/>,
21+
<link
22+
rel="preload"
23+
href="/fonts/Inter-Regular.woff"
24+
as="font"
25+
type="font/woff"
26+
crossOrigin="anonymous"
27+
key="interFont"
28+
/>,
29+
<link
30+
rel="preload"
31+
href="/fonts/IBMPlexMono-Regular.woff2"
32+
as="font"
33+
type="font/woff2"
34+
crossOrigin="anonymous"
35+
key="interFont"
36+
/>,
2137
])
2238
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "7.12.2",
3+
"version": "7.13.0",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "git@github.com:ethereum/ethereum-org-website.git",

src/@chakra-ui/gatsby-plugin/components/Tag.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import {
2+
createMultiStyleConfigHelpers,
3+
theme,
4+
defineStyle,
5+
} from "@chakra-ui/react"
6+
import { tagAnatomy } from "@chakra-ui/anatomy"
7+
import { $badgeColor, STATUS_COLORS } from "./utils"
8+
import { defineMergeStyles } from "../components.utils"
9+
10+
const { definePartsStyle, defineMultiStyleConfig } =
11+
createMultiStyleConfigHelpers(tagAnatomy.keys)
12+
13+
const { Tag: tagTheme } = theme.components
14+
15+
const baseStyleContainer = defineMergeStyles(tagTheme.baseStyle?.container, {
16+
border: "1px",
17+
borderColor: "transparent",
18+
gap: 1,
19+
borderRadius: "full",
20+
px: 2,
21+
minH: 8,
22+
fontWeight: 300,
23+
"&:any-link": {
24+
textDecor: "none",
25+
_focusWithin: {
26+
outline: "4px solid",
27+
outlineColor: "transparent",
28+
outlineOffset: 0,
29+
},
30+
},
31+
})
32+
33+
const baseStyleLabel = defineStyle({
34+
...tagTheme.baseStyle?.label,
35+
fontSize: "xs",
36+
textTransform: "uppercase",
37+
textAlign: "center",
38+
lineHeight: 1,
39+
})
40+
41+
const baseStyleCloseButton = defineStyle({
42+
...tagTheme.baseStyle?.closeButton,
43+
opacity: 1,
44+
m: 0,
45+
// Clear default
46+
_focusVisible: null,
47+
"&:focus-visible, &:hover": {
48+
outline: "3px solid",
49+
outlineOffset: "-2px",
50+
},
51+
})
52+
53+
const baseStyle = definePartsStyle({
54+
container: baseStyleContainer,
55+
label: baseStyleLabel,
56+
closeButton: baseStyleCloseButton,
57+
})
58+
59+
const getStatusStyles = (status: string, variant: string) => {
60+
const statusStyles = STATUS_COLORS[status][variant]
61+
62+
return {
63+
container: statusStyles,
64+
}
65+
}
66+
67+
const variantSubtle = definePartsStyle((props) => {
68+
const { status = "normal" } = props
69+
const defaultStyles = tagTheme.variants?.subtle(props)
70+
const statusStyles = getStatusStyles(status, "subtle")
71+
return {
72+
container: {
73+
...defaultStyles?.container,
74+
// Remove default dark mode styles
75+
_dark: {},
76+
...statusStyles.container,
77+
},
78+
}
79+
})
80+
81+
const variantSolid = definePartsStyle((props) => {
82+
const { status = "normal" } = props
83+
const defaultStyles = tagTheme.variants?.solid(props)
84+
const statusStyles = getStatusStyles(status, "solid")
85+
return {
86+
container: {
87+
...defaultStyles?.container,
88+
// Remove default dark mode styles
89+
_dark: {},
90+
...statusStyles.container,
91+
},
92+
}
93+
})
94+
95+
const variantOutline = definePartsStyle((props) => {
96+
const { status = "normal" } = props
97+
const defaultStyles = tagTheme.variants?.outline(props)
98+
const statusStyles = getStatusStyles(status, "outline")
99+
return {
100+
container: {
101+
...defaultStyles?.container,
102+
boxShadow: "none",
103+
borderColor: $badgeColor.reference,
104+
// Remove default dark mode styles
105+
_dark: {},
106+
...statusStyles.container,
107+
},
108+
}
109+
})
110+
111+
const variants = {
112+
subtle: variantSubtle,
113+
solid: variantSolid,
114+
outline: variantOutline,
115+
}
116+
117+
export const Tag = defineMultiStyleConfig({
118+
baseStyle,
119+
variants,
120+
defaultProps: {
121+
variant: "subtle",
122+
},
123+
})

0 commit comments

Comments
 (0)