1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-30 20:49:49 +02:00

feat: add open source link type (#7351)

* feat: add open source link type

* fix: capitalize link type
This commit is contained in:
Arik Chakma
2024-10-06 06:45:55 +06:00
committed by GitHub
parent c894430a86
commit 55218ea85a
2 changed files with 5 additions and 10 deletions

View File

@@ -3,6 +3,6 @@
"enabled": false
},
"_variables": {
"lastUpdateCheck": 1727095669945
"lastUpdateCheck": 1728161578172
}
}

View File

@@ -29,6 +29,8 @@ type TopicDetailLinkProps = {
export function TopicDetailLink(props: TopicDetailLinkProps) {
const { url, onClick, type, title, isPaid = false } = props;
const linkType = type === 'opensource' ? 'OpenSource' : type;
return (
<a
href={url}
@@ -38,18 +40,11 @@ export function TopicDetailLink(props: TopicDetailLinkProps) {
>
<span
className={cn(
'mr-2 inline-block rounded px-1.5 py-0.5 text-xs uppercase no-underline',
'mr-2 inline-block rounded px-1.5 py-0.5 text-xs capitalize no-underline',
(isPaid ? paidLinkTypes[type] : linkTypes[type]) || 'bg-gray-200',
)}
>
{type === 'opensource' ? (
<>
{url.includes('github') && 'GitHub'}
{url.includes('gitlab') && 'GitLab'}
</>
) : (
type
)}
{linkType}
</span>
{title}
</a>