Skip to content

Commit

Permalink
fix(website): fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Aug 17, 2024
1 parent 854339d commit 44579cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion website/src/components/Footer/Icon.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
const {name} = Astro.props
const { name } = Astro.props as { name: keyof typeof paths };
const paths = {
github: "M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z",
Expand Down
7 changes: 5 additions & 2 deletions website/src/components/Footer/Stars.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { owner, repo } = Astro.props;
constructor() {
super();

const approximate = (count) => {
const approximate = (count: number): string => {
if (count >= 1000) {
// Show numbers over 1000 as x.yk. So 1234 becomes 1.2k.
const mag = Math.trunc(count / 100) / 10;
Expand All @@ -33,7 +33,10 @@ const { owner, repo } = Astro.props;
}
})
.then(data => {
this.querySelector('#star-count').textContent = approximate(data.stargazers_count);
const starCountElement = this.querySelector('#star-count');
if (starCountElement !== null) {
starCountElement.textContent = approximate(data.stargazers_count);
}
}).catch(() => {});
}
}
Expand Down
5 changes: 4 additions & 1 deletion website/src/components/Footer/Version.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const { owner, repo } = Astro.props;
}
})
.then(data => {
this.querySelector("#version").textContent = data[0].name.replace(/^v/, "");
const versionElement = this.querySelector("#version");
if (versionElement !== null) {
versionElement.textContent = data[0].name.replace(/^v/, "");
}
})
.catch(() => {
// Handle the error case (optional)
Expand Down

0 comments on commit 44579cc

Please sign in to comment.