Skip to content

Commit aefa2a2

Browse files
Use cn() function for conditions
1 parent b13033d commit aefa2a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app/(public)/repos/[language]/_components/repo-card.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { RepoItem } from '@/types';
22
import { emojify } from '@twuni/emojify';
33
import { GoIssueOpened, GoRepoForked, GoStar } from 'react-icons/go';
44
import { ReportButton } from './report-button';
5+
import { cn } from '@/lib/utils';
56

67
const MAX_DESCRIPTION_LENGTH = 100;
78
const MAX_TOPICS_DISPLAY = 3;
@@ -82,10 +83,12 @@ export function RepoCard({ repo }: RepoCardProps) {
8283
href={`https://github.com/topics/${topic}`}
8384
target="_blank"
8485
rel="noreferrer"
85-
className={`badge inline px-3 py-0.5 h-auto ${topic === 'hacktoberfest'
86+
className={cn(
87+
'badge inline px-3 py-0.5 h-auto',
88+
topic === 'hacktoberfest'
8689
? 'bg-hacktoberfest-light-green text-hacktoberfest-dark-green'
8790
: 'bg-hacktoberfest-deep-pink text-hacktoberfest-light-pink'
88-
}`}
91+
)}
8992
>
9093
{topic}
9194
</a>

0 commit comments

Comments
 (0)