Skip to content

Commit 6fe76b8

Browse files
author
raineer
committed
Lightning Iconfiltered navigation, feeds and codev overflow
1 parent a2cf07d commit 6fe76b8

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

‎apps/codebility/app/home/(dashboard)/_components/DashboardWeeklyTop.tsx‎

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,30 @@ export default function WeeklyTop() {
200200
}
201201
};
202202

203+
// NEW: Rank-specific lightning icon function
204+
const getRankLightningIcon = (rank: number) => {
205+
switch (rank) {
206+
case 1:
207+
// Violet lightning for rank 1 (top performer)
208+
return (
209+
<div title="Top Performer!">
210+
<Zap className="h-4 w-4 text-violet-500 animate-bounce" />
211+
</div>
212+
);
213+
case 2:
214+
case 3:
215+
// Yellow lightning for ranks 2 and 3
216+
return (
217+
<div title="High Achiever!">
218+
<Zap className="h-4 w-4 text-yellow-500 animate-bounce" />
219+
</div>
220+
);
221+
default:
222+
// No lightning icon for ranks 4-10
223+
return null;
224+
}
225+
};
226+
203227
const getPointsBar = (points: number, maxPoints: number) => {
204228
const percentage = maxPoints > 0 ? (points / maxPoints) * 100 : 0;
205229
return (
@@ -231,7 +255,8 @@ export default function WeeklyTop() {
231255
{hasData ? (
232256
<div className="flex items-center gap-2">
233257
<span>{data.codev?.first_name || "Unknown"}</span>
234-
{i < 3 && <Zap className="h-4 w-4 text-yellow-500 animate-bounce" />}
258+
{/* UPDATED: Rank-specific lightning icon logic */}
259+
{getRankLightningIcon(i + 1)}
235260
</div>
236261
) : (
237262
<span className="text-gray-400">-</span>
@@ -404,4 +429,4 @@ const getRowStyle = (rank: number) => {
404429
}
405430

406431
return "hover:bg-gray-50 dark:hover:bg-gray-800/50 border-b border-gray-100 dark:border-gray-800";
407-
};
432+
};

0 commit comments

Comments
 (0)