@@ -4,6 +4,7 @@ import { useRouter } from "next/router"
4
4
import { useTranslation } from "next-i18next"
5
5
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
6
6
import { FaGithub } from "react-icons/fa"
7
+ import { Badge , chakra , forwardRef } from "@chakra-ui/react"
7
8
8
9
import { BasePageProps , Lang } from "@/lib/types"
9
10
@@ -15,12 +16,7 @@ import PageMetadata from "@/components/PageMetadata"
15
16
import Translation from "@/components/Translation"
16
17
import { getSkillTranslationId , Skill } from "@/components/TutorialMetadata"
17
18
import TutorialTags from "@/components/TutorialTags"
18
- import { Badge } from "@/components/ui/badge"
19
- import {
20
- Button ,
21
- ButtonLink ,
22
- type ButtonProps ,
23
- } from "@/components/ui/buttons/Button"
19
+ import { Button , ButtonLink } from "@/components/ui/buttons/Button"
24
20
import Modal from "@/components/ui/dialog-modal"
25
21
import { Flex , FlexProps } from "@/components/ui/flex"
26
22
@@ -44,29 +40,39 @@ type Props = BasePageProps & {
44
40
internalTutorials : ITutorial [ ]
45
41
}
46
42
47
- type FilterTagProps = {
48
- isActive : boolean
49
- name : string
50
- } & ButtonProps
51
-
52
43
type LinkFlexProps = FlexProps & {
53
44
href : string
54
45
}
55
46
56
- const FilterTag = React . forwardRef < HTMLButtonElement , FilterTagProps > (
57
- ( { isActive, name, ...rest } , ref ) => (
58
- < Button
59
- ref = { ref }
60
- className = { `rounded-sm border bg-gradient-main p-2 uppercase leading-4xs hover:!border-border-high-contrast hover:bg-inherit hover:!text-primary ${
61
- isActive
62
- ? "!border-primary text-body shadow-table"
63
- : "!border-border text-body-medium shadow-none"
64
- } `}
65
- { ...rest }
66
- >
67
- { name }
68
- </ Button >
69
- )
47
+ const FilterTag = forwardRef < { isActive : boolean ; name : string } , "button" > (
48
+ ( props , ref ) => {
49
+ const { isActive, name, ...rest } = props
50
+ return (
51
+ < chakra . button
52
+ ref = { ref }
53
+ bg = "none"
54
+ bgImage = "radial-gradient(46.28% 66.31% at 66.95% 58.35%,rgba(127, 127, 213, 0.2) 0%,rgba(134, 168, 231, 0.2) 50%,rgba(145, 234, 228, 0.2) 100%)"
55
+ border = "1px"
56
+ borderColor = { isActive ? "primary300" : "white800" }
57
+ borderRadius = "base"
58
+ boxShadow = { ! isActive ? "table" : undefined }
59
+ color = "text"
60
+ fontSize = "sm"
61
+ lineHeight = { 1.2 }
62
+ opacity = { isActive ? 1 : 0.7 }
63
+ p = { 2 }
64
+ textTransform = "uppercase"
65
+ _hover = { {
66
+ color : "primary.base" ,
67
+ borderColor : "text200" ,
68
+ opacity : "1" ,
69
+ } }
70
+ { ...rest }
71
+ >
72
+ { name }
73
+ </ chakra . button >
74
+ )
75
+ }
70
76
)
71
77
72
78
FilterTag . displayName = FilterTag . name
@@ -334,15 +340,12 @@ const TutorialPage = ({
334
340
href = { tutorial . href ?? undefined }
335
341
>
336
342
< Flex className = "mb-8 flex-col items-start justify-between gap-y-4 md:-mb-4 md:flex-row" >
337
- < h4
338
- className = { `relative me-0 text-body after:ml-2 after:inline-block after:italic after:transition-all after:duration-100 after:ease-in-out after:content-['↗'] md:me-24 ${ tutorial . isExternal ? "after:inline-block" : "after:hidden" } ` }
343
+ < Text
344
+ className = { `relative me-0 text-2xl font-semibold text- body after:ml-2 after:inline-block after:italic after:transition-all after:duration-100 after:ease-in-out after:content-['↗'] md:me-24 ${ tutorial . isExternal ? "after:inline-block" : "after:hidden" } ` }
339
345
>
340
346
{ tutorial . title }
341
- </ h4 >
342
- < Badge
343
- variant = "secondary"
344
- className = "rounded-sm border border-border text-body"
345
- >
347
+ </ Text >
348
+ < Badge variant = "secondary" >
346
349
< Translation id = { getSkillTranslationId ( tutorial . skill ! ) } />
347
350
</ Badge >
348
351
</ Flex >
0 commit comments