Skip to content

Commit 6e9e042

Browse files
committed
Refactor dashboard components for improved layout and user experience
- Updated LearningProgressSection to enhance search results display and removed redundant header. - Enhanced DashboardLayout with profile menu, fullscreen toggle, and time display. - Simplified LeaderboardPage layout and removed unnecessary animations. - Cleaned up LeaguesPage by removing the header section for a more streamlined view. - Refactored ProfilePage to use consistent icon library and improved layout for user information.
1 parent 46eb757 commit 6e9e042

8 files changed

Lines changed: 380 additions & 315 deletions

File tree

src/components/features/dashboard/AssignmentManagement.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const AssignmentManagement = ({ leagueId }) => {
147147

148148
if (loading) {
149149
return (
150-
<div className="bg-white rounded-lg border border-gray-200 shadow-sm p-6 mt-4">
150+
<div className="bg-white rounded-lg border border-gray-200 p-6 mt-4">
151151
<div className="animate-pulse space-y-4">
152152
<div className="h-6 bg-gray-200 rounded w-1/4"></div>
153153
<div className="h-4 bg-gray-200 rounded w-3/4"></div>
@@ -159,7 +159,7 @@ const AssignmentManagement = ({ leagueId }) => {
159159

160160
if (error) {
161161
return (
162-
<div className="bg-white rounded-lg border border-gray-200 shadow-sm p-6 mt-4">
162+
<div className="bg-white rounded-lg border border-gray-200 p-6 mt-4">
163163
<div className="text-center py-8">
164164
<AlertCircle size={48} className="mx-auto text-red-500 mb-4" />
165165
<h3 className="text-lg font-medium text-gray-900 mb-2">Error Loading Assignment</h3>
@@ -181,7 +181,7 @@ const AssignmentManagement = ({ leagueId }) => {
181181

182182
if (!assignment) {
183183
return (
184-
<div className="bg-white rounded-lg border border-gray-200 shadow-sm p-6 mt-4">
184+
<div className="bg-white rounded-lg border border-gray-200 p-6 mt-4">
185185
<div className="text-center py-8">
186186
<FileText size={48} className="mx-auto text-gray-300 mb-4" />
187187
<h3 className="text-lg font-medium text-gray-900 mb-2">Assignment Coming Soon</h3>
@@ -199,7 +199,7 @@ const AssignmentManagement = ({ leagueId }) => {
199199
return (
200200
<div className="space-y-4 mt-4">
201201
{/* Assignment Details */}
202-
<div className="bg-gradient-to-r from-[#FFDE59]/20 to-[#FFD700]/20 rounded-lg border border-[#FFDE59]/30 shadow-sm">
202+
<div className="bg-gradient-to-r from-[#FFDE59]/20 to-[#FFD700]/20 rounded-lg border border-[#FFDE59]/30">
203203
<div className="px-6 py-4">
204204
<div className="flex items-center justify-between mb-3">
205205
<div className="flex items-center space-x-3">
@@ -302,7 +302,7 @@ const AssignmentManagement = ({ leagueId }) => {
302302

303303
{/* Submission Form */}
304304
{showSubmissionForm && (
305-
<div className="bg-white rounded-lg border border-gray-200 shadow-sm">
305+
<div className="bg-white rounded-lg border border-gray-200">
306306
<div className="px-6 py-4 border-b border-gray-100">
307307
<h3 className="text-lg font-semibold text-gray-900">
308308
{latestSubmission ? 'Resubmit Your Assignment' : 'Submit Your Assignment'}

src/components/features/dashboard/LeagueDetailPage.jsx

Lines changed: 193 additions & 120 deletions
Large diffs are not rendered by default.

src/components/features/dashboard/LearningProgressSection.jsx

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -181,43 +181,33 @@ const LearningProgressSection = ({ user }) => {
181181
<div className="min-h-screen bg-gray-50/30">
182182
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 lg:pt-8 pb-12 lg:pb-16">
183183

184-
{/* Dashboard Header - Similar to LeaguesPage */}
185-
<div className="mb-8 lg:mb-12">
186-
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 lg:mb-4 tracking-tight">
187-
Learning Dashboard
188-
</h1>
189-
<p className="text-lg lg:text-xl text-gray-700 max-w-3xl leading-relaxed">
190-
Track your progress and continue your learning journey with personalized insights
191-
</p>
192-
193-
{/* Search Results Indicator - Dashboard Style */}
194-
{isSearchActive && (
195-
<div className="mt-6 max-w-2xl">
196-
<div className="bg-blue-50/80 backdrop-blur-sm border border-blue-200/50 rounded-2xl p-4 sm:p-6">
197-
<div className="flex items-center gap-3 text-blue-800">
198-
<div className="w-8 h-8 rounded-xl bg-blue-100 flex items-center justify-center">
199-
<Search className="h-4 w-4 text-blue-600" />
200-
</div>
201-
<div className="flex-1">
202-
<span className="text-sm sm:text-base font-medium">
203-
Search results for "<span className="font-semibold">{searchTerm}</span>"
204-
</span>
205-
</div>
206-
<button
207-
onClick={() => {
208-
window.dispatchEvent(new CustomEvent('dashboardSearch', {
209-
detail: { searchTerm: '', isActive: false }
210-
}));
211-
}}
212-
className="text-blue-600 hover:text-blue-800 text-sm font-medium px-3 py-1.5 rounded-lg hover:bg-blue-50 transition-all duration-200"
213-
>
214-
Clear
215-
</button>
184+
{/* Search Results Indicator - Dashboard Style */}
185+
{isSearchActive && (
186+
<div className="mb-8 lg:mb-12 max-w-2xl">
187+
<div className="bg-blue-50/80 backdrop-blur-sm border border-blue-200/50 rounded-2xl p-4 sm:p-6">
188+
<div className="flex items-center gap-3 text-blue-800">
189+
<div className="w-8 h-8 rounded-xl bg-blue-100 flex items-center justify-center">
190+
<Search className="h-4 w-4 text-blue-600" />
191+
</div>
192+
<div className="flex-1">
193+
<span className="text-sm sm:text-base font-medium">
194+
Search results for "<span className="font-semibold">{searchTerm}</span>"
195+
</span>
216196
</div>
197+
<button
198+
onClick={() => {
199+
window.dispatchEvent(new CustomEvent('dashboardSearch', {
200+
detail: { searchTerm: '', isActive: false }
201+
}));
202+
}}
203+
className="text-blue-600 hover:text-blue-800 text-sm font-medium px-3 py-1.5 rounded-lg hover:bg-blue-50 transition-all duration-200"
204+
>
205+
Clear
206+
</button>
217207
</div>
218208
</div>
219-
)}
220-
</div>
209+
</div>
210+
)}
221211

222212
<div className="space-y-6 sm:space-y-8 lg:space-y-10">
223213

@@ -388,7 +378,7 @@ const LearningProgressSection = ({ user }) => {
388378
return (
389379
<div
390380
key={enrollment.league.id}
391-
className="group bg-gradient-to-br from-white to-gray-50/30 rounded-2xl sm:rounded-3xl border border-gray-200/30 hover:border-gray-300/50 transition-all duration-500 hover:-translate-y-2 hover:shadow-xl hover:shadow-gray-200/25 overflow-hidden"
381+
className="group bg-gradient-to-br from-white to-gray-50/30 rounded-2xl sm:rounded-3xl border border-gray-200/30 hover:border-gray-300/50 transition-all duration-500 overflow-hidden"
392382
>
393383
{/* League Header - Enhanced */}
394384
<div className="p-5 sm:p-6 border-b border-gray-100/50">

0 commit comments

Comments
 (0)