Skip to content

Commit 9199905

Browse files
fix: improve styling and layout of Dashboard components for better readability
1 parent 8859046 commit 9199905

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

app/dashboard/page.tsx

+28-31
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
Star,
4141
Timer
4242
} from "lucide-react";
43-
import { count } from "console";
4443

4544
ChartJS.register(
4645
CategoryScale,
@@ -88,7 +87,6 @@ export default function Dashboard() {
8887
}],
8988
};
9089

91-
9290
const processLeetCodeData = (submissionCalendar: string) => {
9391
const parsedData = JSON.parse(submissionCalendar);
9492

@@ -101,7 +99,7 @@ export default function Dashboard() {
10199
return (
102100
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-8">
103101
{/* Profile Header Card */}
104-
<Card className="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-gray-800 dark:to-gray-700">
102+
<Card className="bg-white dark:bg-gray-800 shadow-md rounded-lg">
105103
<CardContent className="p-6">
106104
<div className="flex flex-col md:flex-row items-center gap-6">
107105
<div className="relative w-24 h-24">
@@ -151,19 +149,19 @@ export default function Dashboard() {
151149

152150
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
153151
{/* Activity Calendar Section */}
154-
<Card className="lg:col-span-2 overflow-hidden">
152+
<Card className="lg:col-span-2 overflow-hidden shadow-md rounded-lg">
155153
<CardHeader className="p-4 border-b">
156154
<div className="flex items-center justify-between">
157155
<div className="flex items-center gap-2">
158156
<Calendar className="w-5 h-5 text-green-600" />
159-
<h3 className="font-semibold">Calendar</h3>
157+
<h3 className="font-semibold">Contribution Calendar</h3>
160158
</div>
161159
<span className="text-sm text-gray-500">
162160
{userDetails.submitStats.totalSubmissionNum[0].count} total submissions
163161
</span>
164162
</div>
165163
</CardHeader>
166-
<CardContent className="p-6">
164+
<CardContent className="p-6">
167165
<CalendarHeatmap
168166
values={processLeetCodeData(userDetails.submissionCalendar)}
169167
startDate={new Date(new Date().setFullYear(new Date().getFullYear() - 1))}
@@ -175,31 +173,31 @@ export default function Dashboard() {
175173
return `color-scale-${(value.count)}`;
176174
}}
177175
/>
178-
</CardContent>
179-
<div className="p-4 border-t justify-between">
180-
<div className="flex items-center justify-between">
181-
<div className="flex items-center gap-2">
182-
<Badge className="w-5 h-5 text-sky-600" />
183-
<h3 className="font-semibold">Badges</h3>
184-
</div>
185-
<span className="text-sm text-gray-500">
186-
{(userDetails.badges).length} total badges
187-
</span>
176+
</CardContent>
177+
<div className="p-4 border-t">
178+
<div className="flex items-center justify-between">
179+
<div className="flex items-center gap-2">
180+
<Badge className="w-5 h-5 text-sky-600" />
181+
<h3 className="font-semibold">Badges</h3>
188182
</div>
189-
<CardContent className="p-0">
190-
<div className="flex justify-center items-center gap-4 px-4 py-2">
191-
{userDetails.badges.slice(0, 5).map((badge, idx) => (
192-
<div key={idx} className="flex flex-col items-center bg-gray-500 dark:bg-gray-800 rounded-lg p-3 min-w-[60px] max-w-[100px]">
183+
<span className="text-sm text-gray-500">
184+
{(userDetails.badges).length} total badges
185+
</span>
186+
</div>
187+
<CardContent className="p-0">
188+
<div className="flex justify-center items-center gap-4 px-4 py-2">
189+
{userDetails.badges.slice(0, 5).map((badge, idx) => (
190+
<div key={idx} className="flex flex-col items-center bg-gray-200 dark:bg-gray-700 rounded-lg p-3 min-w-[60px] max-w-[100px]">
193191
<img src={badge.icon} alt={`Badge ${idx + 1}`} className="w-full h-auto object-contain" />
194192
</div>
195-
))}
196-
</div>
197-
</CardContent>
198-
</div>
193+
))}
194+
</div>
195+
</CardContent>
196+
</div>
199197
</Card>
200198

201199
{/* Recent Submissions Card */}
202-
<Card className="h-[400px] overflow-hidden">
200+
<Card className="h-[400px] overflow-hidden shadow-md rounded-lg">
203201
<CardHeader className="p-4 border-b">
204202
<div className="flex items-center justify-between">
205203
<div className="flex items-center gap-2">
@@ -215,13 +213,13 @@ export default function Dashboard() {
215213
href={`https://leetcode.com/problems/${submission.titleSlug}`}
216214
key={idx}
217215
target="_blank"
218-
className="flex items-center p-4 hover:bg-gray-50 transition-colors group"
216+
className="flex items-center p-4 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors group"
219217
>
220218
<div className="flex-1 min-w-0">
221-
<p className="text-sm font-medium text-white-900 truncate group-hover:text-blue-600">
219+
<p className="text-sm font-medium text-gray-900 dark:text-gray-100 truncate group-hover:text-blue-600">
222220
{submission.title}
223221
</p>
224-
<p className="text-xs text-gray-500 mt-1">
222+
<p className="text-xs text-gray-500 dark:text-gray-400 mt-1">
225223
{new Date(Number(submission.timestamp) * 1000).toISOString().split("T")[0]}
226224
</p>
227225
</div>
@@ -292,7 +290,7 @@ export default function Dashboard() {
292290
</div>
293291

294292
{/* Problem Distribution Chart */}
295-
<Card className="bg-white dark:bg-gray-800">
293+
<Card className="bg-white dark:bg-gray-800 shadow-md rounded-lg">
296294
<CardHeader className="p-4 border-b">
297295
<div className="flex items-center justify-between">
298296
<div className="flex items-center gap-2">
@@ -301,7 +299,7 @@ export default function Dashboard() {
301299
</div>
302300
</div>
303301
</CardHeader>
304-
<CardContent className="p-6 flex justify-center">
302+
<CardContent className="p-0 flex justify-center">
305303
<div className="h-64 w-64">
306304
<Doughnut
307305
data={difficultyData}
@@ -414,7 +412,6 @@ function SocialLink({ href, icon }: { href?: string; icon: React.ReactNode }) {
414412
);
415413
}
416414

417-
418415
function DashboardSkeleton() {
419416
return (
420417
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">

0 commit comments

Comments
 (0)