Skip to content

Commit

Permalink
feat: add open source link type (kamranahmedse#7351)
Browse files Browse the repository at this point in the history
* feat: add open source link type

* fix: capitalize link type
  • Loading branch information
arikchakma authored Oct 6, 2024
1 parent c894430 commit 55218ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .astro/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"enabled": false
},
"_variables": {
"lastUpdateCheck": 1727095669945
"lastUpdateCheck": 1728161578172
}
}
13 changes: 4 additions & 9 deletions src/components/TopicDetail/TopicDetailLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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>
Expand Down

0 comments on commit 55218ea

Please sign in to comment.