diff --git a/src/components/ItemDialogContentRenderer.js b/src/components/ItemDialogContentRenderer.js index 0b764aac..2c0709d6 100644 --- a/src/components/ItemDialogContentRenderer.js +++ b/src/components/ItemDialogContentRenderer.js @@ -12,6 +12,7 @@ const icons = require('../utils/icons'); module.exports.render = function({settings, tweetsCount, itemInfo}) { const closeUrl = stringifyParams; + const wideBadges = settings.big_picture.main.wide_badges || false; const formatDate = function(x) { if (x.text) { @@ -147,6 +148,17 @@ module.exports.render = function({settings, tweetsCount, itemInfo}) { `); } + const renderAllTags = function(itemInfo, tweetButton) { + const projectTag = renderProjectTag(itemInfo); + const parentTag = renderParentTag(itemInfo); + const openSourceTag = renderOpenSourceTag(itemInfo.oss); + const licenseTag = renderLicenseTag(itemInfo); + const badgeTag = renderBadgeTag(itemInfo); + return [projectTag, parentTag, openSourceTag, licenseTag, badgeTag, tweetButton].filter(Boolean).map(tag => { + return `
${tag}
` + }).join("\n"); + } + const renderChart = function() { if (!itemInfo.github_data || !itemInfo.github_data.languages) { return ''; @@ -618,7 +630,7 @@ module.exports.render = function({settings, tweetsCount, itemInfo}) { })(); const cellStyle = ` - width: 146px; + width: ${wideBadges ? "296px" : "146px"}; marginRight: 4px; height: 26px; display: inline-block; @@ -632,12 +644,7 @@ module.exports.render = function({settings, tweetsCount, itemInfo}) {
-
${renderProjectTag(itemInfo)}
-
${renderParentTag(itemInfo)}
-
${renderOpenSourceTag(itemInfo.oss)}
-
${renderLicenseTag(itemInfo)}
-
${renderBadgeTag(itemInfo)}
-
${tweetButton}
+ ${renderAllTags(itemInfo, tweetButton)}
${renderChart(itemInfo)} ${renderParticipation(itemInfo)}