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"
0 commit comments