Skip to content

Commit c931f00

Browse files
authored
refactor(dashboard): add loading skeleton for Achievements component (JhaSourav07#470)
## Description Fixes JhaSourav07#368 Implements `AchievementsSkeleton` and integrates it into the dashboard loading sequence. Replaces the generic tall sidebar block with a split layout featuring a ProfileCard placeholder and a 2x2 achievement grid. Standardizes the loading UI by utilizing the existing `shimmer` animation and refactoring arbitrary heights to canonical Tailwind classes (e.g., `h-100`) to improve maintainability and visual consistency during data fetching. ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview <img width="1639" height="963" alt="스크린샷" src="https://github.com/user-attachments/assets/2b88144c-4601-4e9b-b118-d672601d3d1d" /> ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [x] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have started the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [x] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [ ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 19446ce + bf85b1a commit c931f00

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

app/(root)/dashboard/loading.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
import StatsCardSkeleton from '@/components/dashboard/StatsCardSkeleton';
2+
import AchievementsSkeleton from '@/components/dashboard/AchievementsSkeleton';
23

34
export default function DashboardLoading() {
45
return (
56
<div className="p-4 md:p-6 lg:p-8 min-h-screen">
67
<div className="grid grid-cols-1 lg:grid-cols-[300px_1fr_320px] gap-6 lg:gap-8">
78
{/* Left Sidebar Skeleton */}
89
<div className="flex flex-col gap-6">
9-
<div className="h-[480px] rounded-2xl shimmer border border-white/10" />
10+
{/* Profile Card Skeleton Placeholder */}
11+
<div className="h-100 rounded-2xl shimmer border border-white/10" />
12+
13+
{/* Achievements Skeleton */}
14+
<div className="p-6 rounded-xl bg-[#0a0a0a] border border-[rgba(255,255,255,0.08)]">
15+
<div className="flex items-center gap-2.5 mb-5">
16+
<div className="w-4 h-4 shimmer rounded" />
17+
<div className="w-24 h-4 shimmer rounded" />
18+
</div>
19+
<AchievementsSkeleton />
20+
</div>
1021
</div>
1122

1223
{/* Main Content Skeleton */}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function AchievementsSkeleton() {
2+
return (
3+
<div className="grid grid-cols-2 gap-2">
4+
{[...Array(4)].map((_, i) => (
5+
<div key={i} className="h-16 shimmer rounded border border-white/5" />
6+
))}
7+
</div>
8+
);
9+
}

0 commit comments

Comments
 (0)