diff --git a/src/cards/repo-card.js b/src/cards/repo-card.js index 3b10ce2d..b7432eea 100644 --- a/src/cards/repo-card.js +++ b/src/cards/repo-card.js @@ -29,8 +29,8 @@ const DESCRIPTION_MAX_LINES = 3; * @param {string} textColor The color of the text. * @returns {string} Wrapped repo description SVG object. */ -const getBadgeSVG = (label, textColor) => ` - +const getBadgeSVG = (label, textColor, xOffset = 0) => ` + { icon_color, text_color, bg_color, - card_width = 400, + card_width_input, show_owner = false, show = [], show_icons = true, @@ -93,6 +93,12 @@ const renderRepoCard = (repo, options = {}) => { description_lines_count, } = options; + const card_width = card_width_input + ? isNaN(card_width_input) + ? 400 + : card_width_input + : 400; + const i18n = new I18n({ locale, translations: repoCardLocales, @@ -279,10 +285,10 @@ const renderRepoCard = (repo, options = {}) => { ${ isTemplate ? // @ts-ignore - getBadgeSVG(i18n.t("repocard.template"), colors.textColor) + getBadgeSVG(i18n.t("repocard.template"), colors.textColor, card_width - 400) : isArchived ? // @ts-ignore - getBadgeSVG(i18n.t("repocard.archived"), colors.textColor) + getBadgeSVG(i18n.t("repocard.archived"), colors.textColor, card_width - 400) : "" }