You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/best-practices.md
+7-60Lines changed: 7 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Markdown will be translated as whole pages of content, so no specific action is
52
52
53
53
-_tl;dr Each individual JSON entry should be a complete phrase by itself_
54
54
55
-
- This is done using the `Translation` component. However there is an alternative method for regular JS: using the `t` function from `gatsby-plugin-react-i18next`
55
+
- This is done using the `Translation` component. However there is an alternative method for regular JS: using the `t` function from `next-i18next`
56
56
57
57
-**Method one: `<Translation />` component (preferred if only needed in JSX)**
58
58
@@ -66,7 +66,7 @@ Markdown will be translated as whole pages of content, so no specific action is
66
66
-**Methodtwo: `t()`**
67
67
68
68
```tsx
69
-
import { useTranslation } from "gatsby-plugin-react-i18next"
69
+
import { useTranslation } from "next-i18next"
70
70
71
71
// Utilize anywhere in JS using
72
72
const { t } = useTranslation()
@@ -104,7 +104,7 @@ export default ComponentName
104
104
105
105
Weuse [ChakraUI](https://chakra-ui.com/).
106
106
107
-
`src/@chakra-ui/gatsby-plugin/theme.ts`-Holdsallthethemeconfiguration. Thisiswhereyoucanfindthecolors, fonts, componentthemes, variants, etc.
107
+
`src/@chakra-ui/theme.ts`-Holdsallthethemeconfiguration. Thisiswhereyoucanfindthecolors, fonts, componentthemes, variants, etc.
108
108
109
109
-Wrappersorlayoutdivs
110
110
@@ -149,7 +149,7 @@ Use [the Chakra default breakpoints](https://chakra-ui.com/docs/styled-system/th
@@ -177,63 +177,10 @@ import { BsQuestionSquareFill } from "react-icons/bs"
177
177
;<Icon as={BsQuestionSquareFill} />
178
178
```
179
179
180
-
## ImageloadingandAPIcallsusingGraphQL
180
+
## Usingcustom`Image`component
181
181
182
-
- [Gatsby+GraphQL](https://www.gatsbyjs.com/docs/graphql/) used for loading of images and preferred for API calls (in lieu of REST, if possible/practical). Utilizes static page queries that run at build time, not at run time, optimizing performance.
183
-
-Imageloadingexample:
182
+
[NextImage](https://nextjs.org/docs/pages/api-reference/components/image) is the component of choice to handle responsive images. However, we use a custom version of this component that is properly optimized with Chakra. This way we can use style props from Chakra but still be able to forward common or Next Image-specific props to the component for correct usage and rendering.
// These query results get passed as an object `props.data` to your component
231
-
```
232
-
233
-
### Usingcustom`GatsbyImage`
234
-
235
-
[GatsbyImage](https://www.gatsbyjs.com/plugins/gatsby-plugin-image/) is the component of choice to handle responsive images processed through graphql. However, we use a custom version of this component that is properly optimized with Chakra. This way we can use style props from Chakra but still be able to forward common or GatsbyImage-specific props to the Gatsby component for correct usage and rendering.
236
-
237
-
```tsx
238
-
import GatsbyImage from "./components/GatsbyImage"
Copy file name to clipboardExpand all lines: docs/ds-implementation.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This is part of our [Design System implementation epic](https://github.com/ethe
7
7
## Basics
8
8
9
9
- Use Chakra tokens for spacing, sizes, and breakpoints. [Chakra theme docs](https://chakra-ui.com/docs/styled-system/theme)
10
-
- For colors use the semantic tokens defined in [this file](https://github.com/ethereum/ethereum-org-website/blob/dev/src/@chakra-ui/gatsby-plugin/semanticTokens.ts). These tokens will match the color variables used in the DS Figma file
10
+
- For colors use the semantic tokens defined in [this file](https://github.com/ethereum/ethereum-org-website/blob/dev/src/%40chakra-ui/semanticTokens.ts). These tokens will match the color variables used in the DS Figma file
11
11
- Use as many Chakra components and utils as possible
12
12
- Read the [Best Practices doc](https://github.com/ethereum/ethereum-org-website/blob/dev/docs/best-practices.md) for more examples and info
13
13
@@ -29,7 +29,7 @@ If you are implementing:
29
29
30
30
- A base component (a component that already exists in the [Chakra components list](https://chakra-ui.com/docs/components/), for example, the button or inputs)
31
31
- Try to avoid creating a new component file `/ComponentA/index.tsx` if there is no additional or custom logic we need to add to them
32
-
- Create a theme file to override the default Chakra styles with the DS specs. See examples under the [Chakra theme folder](https://github.com/ethereum/ethereum-org-website/blob/dev/src/@chakra-ui/gatsby-plugin/components/)
32
+
- Create a theme file to override the default Chakra styles with the DS specs. See examples under the [Chakra theme folder](https://github.com/ethereum/ethereum-org-website/tree/dev/src/%40chakra-ui/components)
33
33
- Create a `.stories.tsx` file under `src/components/BaseStories`
Copy file name to clipboardExpand all lines: docs/event-tracking.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Event tracking is a great way to validate our design decisions and assumptions.
16
16
17
17
ethereum.org uses Matomo, an open-source alternative to Google Analytics, allowing us to protect user privacy by not sharing any analytics with third parties.
18
18
19
-
We implemented Matomo using the [JavaScript tracking client](https://developer.matomo.org/guides/tracking-javascript-guide) via the [`gatsby-matomo-plugin`](https://github.com/kremalicious/gatsby-plugin-matomo) Gatsby plugin.
19
+
We implemented Matomo using the [JavaScript tracking client](https://developer.matomo.org/guides/tracking-javascript-guide) via the [`@socialgouv/matomo-next`](https://github.com/SocialGouv/matomo-next) package.
0 commit comments