Skip to content

Commit 237ebcc

Browse files
committed
Revert Tag/Badge changes
1 parent 37a264c commit 237ebcc

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

src/pages/developers/tutorials.tsx

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useRouter } from "next/router"
44
import { useTranslation } from "next-i18next"
55
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
66
import { FaGithub } from "react-icons/fa"
7+
import { Badge, chakra, forwardRef } from "@chakra-ui/react"
78

89
import { BasePageProps, Lang } from "@/lib/types"
910

@@ -15,12 +16,7 @@ import PageMetadata from "@/components/PageMetadata"
1516
import Translation from "@/components/Translation"
1617
import { getSkillTranslationId, Skill } from "@/components/TutorialMetadata"
1718
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"
2420
import Modal from "@/components/ui/dialog-modal"
2521
import { Flex, FlexProps } from "@/components/ui/flex"
2622

@@ -44,29 +40,39 @@ type Props = BasePageProps & {
4440
internalTutorials: ITutorial[]
4541
}
4642

47-
type FilterTagProps = {
48-
isActive: boolean
49-
name: string
50-
} & ButtonProps
51-
5243
type LinkFlexProps = FlexProps & {
5344
href: string
5445
}
5546

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+
}
7076
)
7177

7278
FilterTag.displayName = FilterTag.name
@@ -334,15 +340,12 @@ const TutorialPage = ({
334340
href={tutorial.href ?? undefined}
335341
>
336342
<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"}`}
339345
>
340346
{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">
346349
<Translation id={getSkillTranslationId(tutorial.skill!)} />
347350
</Badge>
348351
</Flex>

0 commit comments

Comments
 (0)