From 65cdb1877f71838c03273fe8286cf39f5fafd312 Mon Sep 17 00:00:00 2001 From: Nathan Chu <63111210+nthnchu@users.noreply.github.com> Date: Thu, 30 Jul 2020 11:26:35 -0400 Subject: [PATCH] remove unused code --- src/renderRepoCard.js | 12 +++--------- src/renderStatsCard.js | 2 -- src/renderTopLanguages.js | 3 ++- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/renderRepoCard.js b/src/renderRepoCard.js index 5845e32..9721ebf 100644 --- a/src/renderRepoCard.js +++ b/src/renderRepoCard.js @@ -45,6 +45,7 @@ const renderRepoCard = (repo, options = {}) => { const multiLineDescription = wrapTextMultiline(desc); const descriptionLines = multiLineDescription.length; const lineHeight = 10; + const height = (descriptionLines > 1 ? 120 : 110) + descriptionLines * lineHeight; @@ -56,7 +57,7 @@ const renderRepoCard = (repo, options = {}) => { bg_color, theme, }); - const isGradient = typeof bgColor == 'object'; + const totalStars = kFormatter(stargazers.totalCount); const totalForks = kFormatter(forkCount); @@ -74,14 +75,7 @@ const renderRepoCard = (repo, options = {}) => { `; - const gradient = isGradient ? ` - - - - - - ` - : undefined + const svgLanguage = primaryLanguage ? ` diff --git a/src/renderStatsCard.js b/src/renderStatsCard.js index 1e9ef3c..ace6bcb 100644 --- a/src/renderStatsCard.js +++ b/src/renderStatsCard.js @@ -55,7 +55,6 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { const lheight = parseInt(line_height, 10); - // returns theme based colors with proper overrides and defaults const { titleColor, textColor, iconColor, bgColor } = getCardColors({ title_color, @@ -65,7 +64,6 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { theme, }); - const isGradient = typeof bgColor == 'object'; // Meta data for creating text nodes with createTextNode function const STATS = { stars: { diff --git a/src/renderTopLanguages.js b/src/renderTopLanguages.js index cd85cd7..5ccb2e0 100644 --- a/src/renderTopLanguages.js +++ b/src/renderTopLanguages.js @@ -95,6 +95,7 @@ const renderTopLanguages = (topLangs, options = {}) => { const totalLanguageSize = langs.reduce((acc, curr) => { return acc + curr.size; }, 0); + // returns theme based colors with proper overrides and defaults const { titleColor, textColor, bgColor } = getCardColors({ title_color, @@ -102,7 +103,7 @@ const renderTopLanguages = (topLangs, options = {}) => { bg_color, theme, }); - const isGradient = typeof bgColor == 'object'; + let width = isNaN(card_width) ? 300 : card_width; let height = 45 + (langs.length + 1) * 40;