1
- import React , { useEffect , useMemo , useState } from "react"
1
+ import React , { HTMLAttributes , useEffect , useMemo , useState } from "react"
2
2
import { GetStaticProps , InferGetServerSidePropsType } from "next"
3
3
import { useRouter } from "next/router"
4
4
import { useTranslation } from "next-i18next"
@@ -9,6 +9,7 @@ import { BasePageProps, Lang } from "@/lib/types"
9
9
10
10
import Emoji from "@/components/Emoji"
11
11
import FeedbackCard from "@/components/FeedbackCard"
12
+ import Heading from "@/components/Heading"
12
13
import MainArticle from "@/components/MainArticle"
13
14
import PageMetadata from "@/components/PageMetadata"
14
15
import Translation from "@/components/Translation"
@@ -23,6 +24,7 @@ import {
23
24
import Modal from "@/components/ui/dialog-modal"
24
25
import { Flex , FlexProps } from "@/components/ui/flex"
25
26
27
+ import { cn } from "@/lib/utils/cn"
26
28
import { existsNamespace } from "@/lib/utils/existsNamespace"
27
29
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
28
30
import { trackCustomEvent } from "@/lib/utils/matomo"
@@ -69,6 +71,10 @@ const FilterTag = React.forwardRef<HTMLButtonElement, FilterTagProps>(
69
71
70
72
FilterTag . displayName = FilterTag . name
71
73
74
+ const Text = ( { className, ...props } : HTMLAttributes < HTMLHeadElement > ) => (
75
+ < p className = { cn ( "mb-6" , className ) } { ...props } />
76
+ )
77
+
72
78
const LinkFlex = ( { href, children, ...props } : LinkFlexProps ) => {
73
79
return (
74
80
< Flex asChild { ...props } >
@@ -212,12 +218,12 @@ const TutorialPage = ({
212
218
"page-developers-tutorials:page-tutorials-meta-description"
213
219
) }
214
220
/>
215
- < h1 className = "mx-4 mb-4 mt-4 text-center uppercase leading-xs sm:mx-0 sm:mt-0" >
221
+ < Heading className = "mx-4 mb-4 mt-4 text-center uppercase leading-xs sm:mx-0 sm:mt-0" >
216
222
< Translation id = "page-developers-tutorials:page-tutorial-title" />
217
- </ h1 >
218
- < p className = "mb-4 text-center leading-xs text-body-medium" >
223
+ </ Heading >
224
+ < Text className = "mb-4 text-center leading-xs text-body-medium" >
219
225
< Translation id = "page-developers-tutorials:page-tutorial-subtitle" />
220
- </ p >
226
+ </ Text >
221
227
222
228
< Modal
223
229
open = { isModalOpen }
@@ -228,17 +234,17 @@ const TutorialPage = ({
228
234
< Translation id = "page-developers-tutorials:page-tutorial-submit-btn" />
229
235
}
230
236
>
231
- < p className = "mb-6" >
237
+ < Text >
232
238
< Translation id = "page-developers-tutorials:page-tutorial-listing-policy-intro" />
233
- </ p >
239
+ </ Text >
234
240
< Flex className = "flex-col gap-2 md:flex-row" >
235
241
< Flex className = "w-full flex-col justify-between rounded-sm border border-border p-4" >
236
242
< b >
237
243
< Translation id = "page-developers-tutorials:page-tutorial-create-an-issue" />
238
244
</ b >
239
- < p className = "mb-6" >
245
+ < Text >
240
246
< Translation id = "page-developers-tutorials:page-tutorial-create-an-issue-desc" />
241
- </ p >
247
+ </ Text >
242
248
< ButtonLink
243
249
variant = "outline"
244
250
href = "https://github.com/ethereum/ethereum-org-website/issues/new?assignees=& labels = Type % 3 A + Feature & template = suggest_tutorial . yaml & title = "
@@ -300,12 +306,12 @@ const TutorialPage = ({
300
306
{ filteredTutorials . length === 0 && (
301
307
< div className = "mt-0 p-12 text-center" >
302
308
< Emoji text = ":crying_face:" className = "my-8 text-5xl" />
303
- < h2 className = "my-8 leading-xs" >
309
+ < h2 className = "mb-8 mt-12 leading-xs" >
304
310
< Translation id = "page-developers-tutorials:page-tutorial-tags-error" />
305
311
</ h2 >
306
- < p >
312
+ < Text >
307
313
< Translation id = "page-developers-tutorials:page-find-wallet-try-removing" />
308
- </ p >
314
+ </ Text >
309
315
</ div >
310
316
) }
311
317
{ filteredTutorials . map ( ( tutorial ) => {
@@ -328,7 +334,7 @@ const TutorialPage = ({
328
334
< Translation id = { getSkillTranslationId ( tutorial . skill ! ) } />
329
335
</ Badge >
330
336
</ Flex >
331
- < p className = "my -6 uppercase text-body-medium" >
337
+ < Text className = "mt -6 uppercase text-body-medium" >
332
338
< Emoji text = ":writing_hand:" className = "me-2 text-sm" />
333
339
{ tutorial . author }
334
340
{ tutorial . published ? (
@@ -352,8 +358,8 @@ const TutorialPage = ({
352
358
</ span >
353
359
</ >
354
360
) }
355
- </ p >
356
- < p className = "mb-6 text-body-medium" > { tutorial . description } </ p >
361
+ </ Text >
362
+ < Text className = "text-body-medium" > { tutorial . description } </ Text >
357
363
< Flex className = "w-full flex-wrap" >
358
364
< TutorialTags tags = { tutorial . tags ?? [ ] } />
359
365
</ Flex >
0 commit comments