Skip to content

Commit 7b4b2f9

Browse files
committed
correct heading element
1 parent fa6c4cb commit 7b4b2f9

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

src/pages/developers/tutorials.tsx

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useMemo, useState } from "react"
1+
import React, { HTMLAttributes, useEffect, useMemo, useState } from "react"
22
import { GetStaticProps, InferGetServerSidePropsType } from "next"
33
import { useRouter } from "next/router"
44
import { useTranslation } from "next-i18next"
@@ -9,6 +9,7 @@ import { BasePageProps, Lang } from "@/lib/types"
99

1010
import Emoji from "@/components/Emoji"
1111
import FeedbackCard from "@/components/FeedbackCard"
12+
import Heading from "@/components/Heading"
1213
import MainArticle from "@/components/MainArticle"
1314
import PageMetadata from "@/components/PageMetadata"
1415
import Translation from "@/components/Translation"
@@ -23,6 +24,7 @@ import {
2324
import Modal from "@/components/ui/dialog-modal"
2425
import { Flex, FlexProps } from "@/components/ui/flex"
2526

27+
import { cn } from "@/lib/utils/cn"
2628
import { existsNamespace } from "@/lib/utils/existsNamespace"
2729
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
2830
import { trackCustomEvent } from "@/lib/utils/matomo"
@@ -69,6 +71,10 @@ const FilterTag = React.forwardRef<HTMLButtonElement, FilterTagProps>(
6971

7072
FilterTag.displayName = FilterTag.name
7173

74+
const Text = ({ className, ...props }: HTMLAttributes<HTMLHeadElement>) => (
75+
<p className={cn("mb-6", className)} {...props} />
76+
)
77+
7278
const LinkFlex = ({ href, children, ...props }: LinkFlexProps) => {
7379
return (
7480
<Flex asChild {...props}>
@@ -212,12 +218,12 @@ const TutorialPage = ({
212218
"page-developers-tutorials:page-tutorials-meta-description"
213219
)}
214220
/>
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">
216222
<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">
219225
<Translation id="page-developers-tutorials:page-tutorial-subtitle" />
220-
</p>
226+
</Text>
221227

222228
<Modal
223229
open={isModalOpen}
@@ -228,17 +234,17 @@ const TutorialPage = ({
228234
<Translation id="page-developers-tutorials:page-tutorial-submit-btn" />
229235
}
230236
>
231-
<p className="mb-6">
237+
<Text>
232238
<Translation id="page-developers-tutorials:page-tutorial-listing-policy-intro" />
233-
</p>
239+
</Text>
234240
<Flex className="flex-col gap-2 md:flex-row">
235241
<Flex className="w-full flex-col justify-between rounded-sm border border-border p-4">
236242
<b>
237243
<Translation id="page-developers-tutorials:page-tutorial-create-an-issue" />
238244
</b>
239-
<p className="mb-6">
245+
<Text>
240246
<Translation id="page-developers-tutorials:page-tutorial-create-an-issue-desc" />
241-
</p>
247+
</Text>
242248
<ButtonLink
243249
variant="outline"
244250
href="https://github.com/ethereum/ethereum-org-website/issues/new?assignees=&labels=Type%3A+Feature&template=suggest_tutorial.yaml&title="
@@ -300,12 +306,12 @@ const TutorialPage = ({
300306
{filteredTutorials.length === 0 && (
301307
<div className="mt-0 p-12 text-center">
302308
<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">
304310
<Translation id="page-developers-tutorials:page-tutorial-tags-error" />
305311
</h2>
306-
<p>
312+
<Text>
307313
<Translation id="page-developers-tutorials:page-find-wallet-try-removing" />
308-
</p>
314+
</Text>
309315
</div>
310316
)}
311317
{filteredTutorials.map((tutorial) => {
@@ -328,7 +334,7 @@ const TutorialPage = ({
328334
<Translation id={getSkillTranslationId(tutorial.skill!)} />
329335
</Badge>
330336
</Flex>
331-
<p className="my-6 uppercase text-body-medium">
337+
<Text className="mt-6 uppercase text-body-medium">
332338
<Emoji text=":writing_hand:" className="me-2 text-sm" />
333339
{tutorial.author}
334340
{tutorial.published ? (
@@ -352,8 +358,8 @@ const TutorialPage = ({
352358
</span>
353359
</>
354360
)}
355-
</p>
356-
<p className="mb-6 text-body-medium">{tutorial.description}</p>
361+
</Text>
362+
<Text className="text-body-medium">{tutorial.description}</Text>
357363
<Flex className="w-full flex-wrap">
358364
<TutorialTags tags={tutorial.tags ?? []} />
359365
</Flex>

0 commit comments

Comments
 (0)