Skip to content

Commit 50e50d0

Browse files
committed
adjust tag filter styles
1 parent e204373 commit 50e50d0

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

src/pages/developers/tutorials.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import TutorialTags from "@/components/TutorialTags"
1919
import { Button, ButtonLink } from "@/components/ui/buttons/Button"
2020
import Modal from "@/components/ui/dialog-modal"
2121
import { Flex, FlexProps } from "@/components/ui/flex"
22-
import { Tag } from "@/components/ui/tag"
22+
import { Tag, TagButton } from "@/components/ui/tag"
2323

2424
import { cn } from "@/lib/utils/cn"
2525
import { existsNamespace } from "@/lib/utils/existsNamespace"
@@ -49,16 +49,15 @@ const FilterTag = forwardRef<{ isActive: boolean; name: string }, "button">(
4949
(props, ref) => {
5050
const { isActive, name, ...rest } = props
5151
return (
52-
<Tag
52+
<TagButton
53+
ref={ref}
5354
variant={isActive ? "solid" : "outline"}
5455
status={isActive ? "tag" : "normal"}
55-
className="hover:border-primary-hover"
56-
asChild
56+
className="justify-center"
57+
{...rest}
5758
>
58-
<Button ref={ref} {...rest}>
59-
{name}
60-
</Button>
61-
</Tag>
59+
{name}
60+
</TagButton>
6261
)
6362
}
6463
)
@@ -278,17 +277,19 @@ const TutorialPage = ({
278277
<div className="my-8 w-full shadow-table-box md:w-2/3">
279278
<Flex className="m-8 flex-col justify-center border-b border-border px-0 pb-4 pt-4 md:pb-8">
280279
<Flex className="mb-4 max-w-full flex-wrap items-center gap-2">
281-
{Object.entries(allTags).map(([tagName, tagCount], idx) => {
282-
const name = `${tagName} (${tagCount})`
283-
const isActive = selectedTags.includes(tagName)
284-
return (
285-
<FilterTag
286-
key={idx}
287-
onClick={() => handleTagSelect(tagName)}
288-
{...{ name, isActive }}
289-
/>
290-
)
291-
})}
280+
<div className="flex w-full flex-wrap gap-2 lg:grid lg:grid-cols-3 lg:gap-4 xl:grid-cols-4 2xl:grid-cols-5">
281+
{Object.entries(allTags).map(([tagName, tagCount], idx) => {
282+
const name = `${tagName} (${tagCount})`
283+
const isActive = selectedTags.includes(tagName)
284+
return (
285+
<FilterTag
286+
key={idx}
287+
onClick={() => handleTagSelect(tagName)}
288+
{...{ name, isActive }}
289+
/>
290+
)
291+
})}
292+
</div>
292293
{selectedTags.length > 0 && (
293294
<Button
294295
className="cursor-pointer p-0 text-primary underline"

0 commit comments

Comments
 (0)