Skip to content

Commit

Permalink
chore(website): update star count
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Aug 24, 2024
1 parent 74274f5 commit 54f72e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions website/src/components/Footer/Stars.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { owner, repo } = Astro.props;
---

<project-stars data-owner={owner} data-repo={repo}>
<span id="star-count">0+</span>
<p class="star-count">0+</p>
</project-stars>

<script>
Expand All @@ -18,8 +18,9 @@ const { owner, repo } = Astro.props;
return `${mag}k+`;
} else {
// Show numbers below 1000 as xy0+. So 789 becomes 780.
const mag = Math.trunc(count / 10) * 10;
return `${mag}+`;
// const mag = Math.trunc(count / 10) * 10;
// return `${mag}+`;
return `${count}+`;
}
}

Expand All @@ -33,8 +34,8 @@ const { owner, repo } = Astro.props;
}
})
.then(data => {
const starCountElement = this.querySelector('#star-count');
if (starCountElement !== null) {
const starCountElement = document.querySelector('.star-count');
if (starCountElement) {
starCountElement.textContent = approximate(data.stargazers_count);
}
}).catch(() => {});
Expand Down

0 comments on commit 54f72e6

Please sign in to comment.