Skip to content

Commit fcff9c5

Browse files
committed
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.
1 parent b28a280 commit fcff9c5

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

docs/skillkit/App.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ export default function App(): React.ReactElement {
123123
<svg className="w-3.5 h-3.5 text-zinc-500 group-hover:text-yellow-500 transition-colors" fill="currentColor" viewBox="0 0 24 24">
124124
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
125125
</svg>
126-
<span className="text-xs font-mono text-zinc-400 group-hover:text-white transition-colors">{stats.stars}</span>
126+
<span className="text-xs font-mono text-zinc-400 group-hover:text-white transition-colors">{stats.stars || '—'}</span>
127127
</a>
128128
</div>
129129
</div>
130130
</div>
131131
</nav>
132132

133133
<main className="pt-14">
134-
<Hero version={stats.version} stars={stats.stars} />
134+
<Hero version={stats.version || '—'} stars={stats.stars || '—'} />
135135

136136
<div className="border-b border-zinc-800/50 py-2.5" style={{ background: 'linear-gradient(to bottom, rgba(9,9,11,0.95), rgba(0,0,0,1))' }}>
137137
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
@@ -143,7 +143,7 @@ export default function App(): React.ReactElement {
143143
className="flex items-center gap-1.5 text-zinc-500 hover:text-white transition-colors group"
144144
>
145145
<span className="text-zinc-600 group-hover:text-zinc-400">v</span>
146-
<span className="text-white font-medium">{stats.version}</span>
146+
<span className="text-white font-medium">{stats.version || '—'}</span>
147147
</a>
148148
<span className="text-zinc-800">·</span>
149149
<a
@@ -155,7 +155,7 @@ export default function App(): React.ReactElement {
155155
<svg className="w-3 h-3 text-zinc-600 group-hover:text-zinc-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
156156
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
157157
</svg>
158-
<span className="text-white font-medium">{stats.downloads}</span>
158+
<span className="text-white font-medium">{stats.downloads || '—'}</span>
159159
</a>
160160
<span className="text-zinc-800">·</span>
161161
<a
@@ -167,7 +167,7 @@ export default function App(): React.ReactElement {
167167
<svg className="w-3 h-3 text-zinc-600 group-hover:text-yellow-500" fill="currentColor" viewBox="0 0 24 24">
168168
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
169169
</svg>
170-
<span className="text-white font-medium">{stats.stars}</span>
170+
<span className="text-white font-medium">{stats.stars || '—'}</span>
171171
</a>
172172
<span className="text-zinc-800 hidden sm:inline">·</span>
173173
<a

docs/skillkit/components/Hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export function Hero({ version, stars }: HeroProps): React.ReactElement {
169169
<path fillRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clipRule="evenodd" />
170170
</svg>
171171
<span className="font-mono text-sm text-zinc-300 group-hover:text-white transition-colors">Star</span>
172-
{typeof stars === 'number' && (
172+
{typeof stars === 'number' && stars > 0 && (
173173
<>
174174
<span className="w-px h-4 bg-zinc-700"></span>
175175
<svg className="w-3.5 h-3.5 text-yellow-500" fill="currentColor" viewBox="0 0 24 24">

docs/skillkit/hooks/useStats.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ function setCachedStats(data: Omit<Stats, 'loading'>): void {
5454

5555
export function useStats(): Stats {
5656
const [stats, setStats] = useState<Stats>({
57-
version: '1.9.0',
58-
downloads: '2.4k',
59-
stars: 66,
57+
version: '',
58+
downloads: '',
59+
stars: 0,
6060
loading: true,
6161
});
6262

@@ -74,9 +74,9 @@ export function useStats(): Stats {
7474
fetch('https://api.github.com/repos/rohitg00/skillkit'),
7575
]);
7676

77-
let downloads = '2.4k';
78-
let stars = 66;
79-
let version = '1.9.0';
77+
let downloads = '';
78+
let stars = 0;
79+
let version = '';
8080

8181
if (npmResponse.status === 'fulfilled' && npmResponse.value.ok) {
8282
const npmData = await npmResponse.value.json();

0 commit comments

Comments
 (0)