From fcff9c5e7df433e1219623f7f419cd6a203c5fbd Mon Sep 17 00:00:00 2001 From: Rohit Ghumare <48523873+rohitg00@users.noreply.github.com> Date: Sun, 8 Feb 2026 20:29:07 +0000 Subject: [PATCH] fix: remove hardcoded initial stars count from website loader Replace stale hardcoded fallback values (66 stars, 2.4k downloads, v1.9.0) with empty/zero defaults that show a dash placeholder while loading. Real values populate once the API responds. --- docs/skillkit/App.tsx | 10 +++++----- docs/skillkit/components/Hero.tsx | 2 +- docs/skillkit/hooks/useStats.ts | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/skillkit/App.tsx b/docs/skillkit/App.tsx index 03419bde..24dee10c 100644 --- a/docs/skillkit/App.tsx +++ b/docs/skillkit/App.tsx @@ -123,7 +123,7 @@ export default function App(): React.ReactElement { - {stats.stars} + {stats.stars || '—'} @@ -131,7 +131,7 @@ export default function App(): React.ReactElement {
- +
@@ -143,7 +143,7 @@ export default function App(): React.ReactElement { className="flex items-center gap-1.5 text-zinc-500 hover:text-white transition-colors group" > v - {stats.version} + {stats.version || '—'} · - {stats.downloads} + {stats.downloads || '—'} · - {stats.stars} + {stats.stars || '—'} · Star - {typeof stars === 'number' && ( + {typeof stars === 'number' && stars > 0 && ( <> diff --git a/docs/skillkit/hooks/useStats.ts b/docs/skillkit/hooks/useStats.ts index b9d4d61c..52034d9c 100644 --- a/docs/skillkit/hooks/useStats.ts +++ b/docs/skillkit/hooks/useStats.ts @@ -54,9 +54,9 @@ function setCachedStats(data: Omit): void { export function useStats(): Stats { const [stats, setStats] = useState({ - version: '1.9.0', - downloads: '2.4k', - stars: 66, + version: '', + downloads: '', + stars: 0, loading: true, }); @@ -74,9 +74,9 @@ export function useStats(): Stats { fetch('https://api.github.com/repos/rohitg00/skillkit'), ]); - let downloads = '2.4k'; - let stars = 66; - let version = '1.9.0'; + let downloads = ''; + let stars = 0; + let version = ''; if (npmResponse.status === 'fulfilled' && npmResponse.value.ok) { const npmData = await npmResponse.value.json();