remove unused code

This commit is contained in:
Nathan Chu 2020-07-30 11:26:35 -04:00
parent b0362c4e12
commit 65cdb1877f
3 changed files with 5 additions and 12 deletions

View File

@ -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 = {}) => {
</text>
</g>
`;
const gradient = isGradient ? `
<defs>
<linearGradient id="gradient" gradientTransform="rotate(${bgColor[0]})">
<stop offset="0%" stop-color="#${bgColor[1]}" />
<stop offset="100%" stop-color="#${bgColor[2]}" />
</linearGradient>
</defs>`
: undefined
const svgLanguage = primaryLanguage
? `
<g data-testid="primary-lang" transform="translate(30, 0)">

View File

@ -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: {

View File

@ -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;