fix: no stars print if undefined

- fixes at the same time undefined stars when rehydratation
This commit is contained in:
Térence Hollander
2021-08-30 22:43:58 +02:00
parent 0aee085e74
commit bda30353bb

View File

@@ -95,16 +95,15 @@
<Tag title={tag} variant='blue' /> <Tag title={tag} variant='blue' />
{/each} {/each}
</div> </div>
{#if stars > 0}
<div class="card__bottom"> <div class="card__bottom">
<div> <div>
{#if stars > 0}
{#if (repo || url).includes('github')} {#if (repo || url).includes('github')}
<img style="display:inline" src="/images/github_logo.svg" alt="github logo" /> <img style="display:inline" src="/images/github_logo.svg" alt="github logo" />
{:else if (repo || url).includes('gitlab')} {:else if (repo || url).includes('gitlab')}
<img style="display:inline" src="/images/gitlab_logo.svg" alt="gitlab logo" /> <img style="display:inline" src="/images/gitlab_logo.svg" alt="gitlab logo" />
<!-- {:else} --> <!-- {:else} -->
{/if} {/if}
{/if}
</div> </div>
<div> <div>
&#9733; &#9733;
@@ -113,4 +112,5 @@
<!-- commenting out dates just cause it is not very updated yet - all the cards show same date. put back in when we have better scraping --> <!-- commenting out dates just cause it is not very updated yet - all the cards show same date. put back in when we have better scraping -->
<!-- <datetime value={addedOn}>{new Intl.DateTimeFormat('en-Us').format(Date.parse(addedOn))}</datetime> --> <!-- <datetime value={addedOn}>{new Intl.DateTimeFormat('en-Us').format(Date.parse(addedOn))}</datetime> -->
</div> </div>
{/if}
</div> </div>