chore: Hide star and fork stats in repo card if count of equals to zero (#97)
* add show_icons option to show/hide star and fork icon in repo cards * resolve conflict * resolve conflict * hide star and fork stats in repo card if count of equals to zero * HOTFIX * HOTFIX
This commit is contained in:
parent
f27daeb931
commit
06f0021660
1 changed files with 16 additions and 12 deletions
|
@ -67,19 +67,23 @@ const renderRepoCard = (repo, options = {}) => {
|
||||||
<text data-testid="lang" class="gray" x="15">${langName}</text>
|
<text data-testid="lang" class="gray" x="15">${langName}</text>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<g transform="translate(${155 - shiftText}, 100)">
|
${(stargazers.totalCount > 0) ? `
|
||||||
<svg class="icon" y="-12" viewBox="0 0 16 16" version="1.1" width="16" height="16">
|
<g transform="translate(${155 - shiftText}, 100)">
|
||||||
${icons.star}
|
<svg class="icon" y="-12" viewBox="0 0 16 16" version="1.1" width="16" height="16">
|
||||||
</svg>
|
${icons.star}
|
||||||
<text data-testid="stargazers" class="gray" x="25">${totalStars}</text>
|
</svg>
|
||||||
</g>
|
<text data-testid="stargazers" class="gray" x="25">${totalStars}</text>
|
||||||
|
</g>
|
||||||
|
` : ''}
|
||||||
|
|
||||||
<g transform="translate(${220 - shiftText}, 100)">
|
${(totalForks > 0) ? `
|
||||||
<svg class="icon" y="-12" viewBox="0 0 16 16" version="1.1" width="16" height="16">
|
<g transform="translate(${stargazers.totalCount === 0 ? 155 - shiftText : 220 - shiftText}, 100)">
|
||||||
${icons.fork}
|
<svg class="icon" y="-12" viewBox="0 0 16 16" version="1.1" width="16" height="16">
|
||||||
</svg>
|
${icons.fork}
|
||||||
<text data-testid="forkcount" class="gray" x="25">${totalForks}</text>
|
</svg>
|
||||||
</g>
|
<text data-testid="forkcount" class="gray" x="25">${totalForks}</text>
|
||||||
|
</g>
|
||||||
|
` : ''}
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue