Skip to content

Commit 12b7250

Browse files
committed
fix tanstack pill links when they don't exist
1 parent 3daca92 commit 12b7250

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

src/components/MaintainerCard.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,32 @@ function SpecialtyChip({ specialty }: { specialty: string }) {
8484
}
8585

8686
function LibraryBadge({ library }: { library: Library }) {
87+
if (library.to) {
88+
return (
89+
<a
90+
href={`${library.to}/latest/docs/contributors`}
91+
className={`inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold text-green-900 dark:text-green-200 ${
92+
library.bgStyle ?? 'bg-gray-500'
93+
} bg-opacity-40 dark:bg-opacity-30 capitalize hover:underline focus:outline-none focus:ring-2 focus:ring-blue-400 transition-colors`}
94+
aria-label={`View contributors for ${library.name}`}
95+
tabIndex={0}
96+
onClick={(e) => e.stopPropagation()}
97+
title={`View all contributors for ${library.name}`}
98+
>
99+
{library.name.replace('TanStack', '🌴')}
100+
</a>
101+
)
102+
}
87103
return (
88-
<a
89-
href={`/${library.id}/latest/docs/contributors`}
104+
<span
90105
className={`inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold text-green-900 dark:text-green-200 ${
91106
library.bgStyle ?? 'bg-gray-500'
92-
} bg-opacity-40 dark:bg-opacity-30 capitalize hover:underline focus:outline-none focus:ring-2 focus:ring-blue-400 transition-colors`}
107+
} bg-opacity-40 dark:bg-opacity-30 capitalize`}
93108
aria-label={`View contributors for ${library.name}`}
94-
tabIndex={0}
95-
onClick={(e) => e.stopPropagation()}
96109
title={`View all contributors for ${library.name}`}
97110
>
98111
{library.name.replace('TanStack', '🌴')}
99-
</a>
112+
</span>
100113
)
101114
}
102115

0 commit comments

Comments
 (0)