Skip to content

Commit 0aa8974

Browse files
committed
feat: enhance loading state UI with improved skeleton screens
1 parent cdc9d6b commit 0aa8974

File tree

1 file changed

+47
-6
lines changed

1 file changed

+47
-6
lines changed

src/components/dashboard/LearningProgressSection.jsx

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,53 @@ const LearningProgressSection = ({ user }) => {
172172

173173
if (loading) {
174174
return (
175-
<div className="space-y-6">
176-
<div className="bg-white rounded-lg shadow-sm border p-6">
177-
<div className="animate-pulse space-y-4">
178-
<div className="h-4 bg-gray-200 rounded w-1/4"></div>
179-
<div className="h-8 bg-gray-200 rounded"></div>
180-
<div className="h-4 bg-gray-200 rounded w-3/4"></div>
175+
<div className="min-h-screen bg-gray-50">
176+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
177+
<div className="animate-pulse space-y-6">
178+
{/* Header skeleton */}
179+
<div className="bg-white rounded-2xl border border-gray-100 p-6 space-y-4">
180+
<div className="h-8 bg-gray-200 rounded w-1/3"></div>
181+
<div className="h-4 bg-gray-200 rounded w-2/3"></div>
182+
</div>
183+
184+
{/* Progress stats skeleton */}
185+
<div className="bg-white rounded-2xl border border-gray-100 p-6">
186+
<div className="h-6 bg-gray-200 rounded w-1/4 mb-6"></div>
187+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
188+
{[1, 2, 3].map(i => (
189+
<div key={i} className="text-center space-y-4">
190+
<div className="w-20 h-20 bg-gray-200 rounded-full mx-auto"></div>
191+
<div className="h-4 bg-gray-200 rounded w-24 mx-auto"></div>
192+
<div className="h-3 bg-gray-200 rounded w-16 mx-auto"></div>
193+
</div>
194+
))}
195+
</div>
196+
</div>
197+
198+
{/* Available Learning Paths skeleton */}
199+
<div className="bg-white rounded-2xl border border-gray-100 p-6">
200+
<div className="h-6 bg-gray-200 rounded w-1/3 mb-6"></div>
201+
<div className="space-y-4">
202+
{[1, 2, 3].map(i => (
203+
<div key={i} className="border border-gray-100 rounded-xl p-6">
204+
<div className="h-5 bg-gray-200 rounded w-1/4 mb-4"></div>
205+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
206+
{[1, 2].map(j => (
207+
<div key={j} className="p-4 bg-gray-50 rounded-lg">
208+
<div className="h-4 bg-gray-200 rounded w-3/4 mb-2"></div>
209+
<div className="h-3 bg-gray-200 rounded w-full mb-3"></div>
210+
<div className="flex space-x-2">
211+
<div className="h-3 bg-gray-200 rounded w-12"></div>
212+
<div className="h-3 bg-gray-200 rounded w-16"></div>
213+
<div className="h-3 bg-gray-200 rounded w-14"></div>
214+
</div>
215+
</div>
216+
))}
217+
</div>
218+
</div>
219+
))}
220+
</div>
221+
</div>
181222
</div>
182223
</div>
183224
</div>

0 commit comments

Comments
 (0)