Skip to content

Commit 18e4c14

Browse files
committed
refactor: tag style perfect
1 parent fb6d527 commit 18e4c14

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

client/src/components/Tags/index.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TagOutlined } from '@ant-design/icons';
2-
import { Tag } from 'antd';
2+
import { Tag, Flex } from 'antd';
33
import { useTranslations } from 'next-intl';
44
import Link from 'next/link';
55

@@ -55,15 +55,17 @@ export const Tags: FC<ITagsProps> = ({ tags = [], needTitle = true, style: cssSt
5555
</TagCloud>
5656
) : (
5757
<ul className={style.tagWrapper}>
58-
{tags.map((tag, index) => (
59-
<Tag key={tag.id} color={getColorFromNumber(index)} className={style.item}>
60-
<Link href={`/tag/[tag]`} as={`/tag/` + tag.value} scroll={false}>
61-
<a aria-label={tag.label} className={style.link}>
62-
{tag.label} [{tag.articleCount}]
63-
</a>
64-
</Link>
65-
</Tag>
66-
))}
58+
<Flex wrap gap="small">
59+
{tags.map((tag, index) => (
60+
<Tag key={tag.id} color={getColorFromNumber(index)} className={style.item}>
61+
<Link href={`/tag/[tag]`} as={`/tag/` + tag.value} scroll={false}>
62+
<a aria-label={tag.label} className={style.link}>
63+
{tag.label} [{tag.articleCount}]
64+
</a>
65+
</Link>
66+
</Tag>
67+
))}
68+
</Flex>
6769
</ul>
6870
)}
6971
</div>

0 commit comments

Comments
 (0)