Skip to content

Commit 8859046

Browse files
feat: add badges section to Dashboard with total count and display of icons
1 parent c865bc2 commit 8859046

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

app/dashboard/page.tsx

+23-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ import {
3434
Code,
3535
Target,
3636
Award,
37-
Hash,
37+
Badge,
3838
Calendar,
3939
CheckCircle,
4040
Star,
4141
Timer
4242
} from "lucide-react";
43+
import { count } from "console";
4344

4445
ChartJS.register(
4546
CategoryScale,
@@ -155,7 +156,7 @@ export default function Dashboard() {
155156
<div className="flex items-center justify-between">
156157
<div className="flex items-center gap-2">
157158
<Calendar className="w-5 h-5 text-green-600" />
158-
<h3 className="font-semibold">Contribution Calendar</h3>
159+
<h3 className="font-semibold">Calendar</h3>
159160
</div>
160161
<span className="text-sm text-gray-500">
161162
{userDetails.submitStats.totalSubmissionNum[0].count} total submissions
@@ -175,6 +176,26 @@ export default function Dashboard() {
175176
}}
176177
/>
177178
</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>
188+
</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]">
193+
<img src={badge.icon} alt={`Badge ${idx + 1}`} className="w-full h-auto object-contain" />
194+
</div>
195+
))}
196+
</div>
197+
</CardContent>
198+
</div>
178199
</Card>
179200

180201
{/* Recent Submissions Card */}

0 commit comments

Comments
 (0)