Skip to content

Commit

Permalink
Update repo-card.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarbendale2004 authored Oct 1, 2024
1 parent 57ccffc commit fb03057
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions src/cards/repo-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,25 +169,29 @@ const renderRepoCard = (repo, options = {}) => {
.badge rect { opacity: 0.2 }
`);

return card.render(`
${
isTemplate
? // @ts-ignore
getBadgeSVG(i18n.t("repocard.template"), colors.textColor)
: isArchived
? // @ts-ignore
getBadgeSVG(i18n.t("repocard.archived"), colors.textColor)
: ""
}
<text class="description" x="25" y="-5">
${descriptionSvg}
</text>
<g transform="translate(30, ${height - 75})">
${starAndForkCount}
</g>
`);
return `
<a href="https://github.com/${nameWithOwner}" target="_blank" rel="noopener noreferrer">
${card.render(`
${
isTemplate
? // @ts-ignore
getBadgeSVG(i18n.t("repocard.template"), colors.textColor)
: isArchived
? // @ts-ignore
getBadgeSVG(i18n.t("repocard.archived"), colors.textColor)
: ""
}
<text class="description" x="25" y="-5">
${descriptionSvg}
</text>
<g transform="translate(30, ${height - 75})">
${starAndForkCount}
</g>
`)}
</a>
`;
};

export { renderRepoCard };
Expand Down

0 comments on commit fb03057

Please sign in to comment.