From 8d26cb8561d716722de152286d1a23992e798a58 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Tue, 3 Feb 2026 15:17:51 +0100 Subject: [PATCH] Profile stat card --- src/app/leaderboards/page.tsx | 14 ++---- .../profile/components/ProfileStatCard.tsx | 46 +++++++++++++++++++ src/app/profile/page.tsx | 10 ++-- src/app/runs/page.tsx | 10 ++-- src/components/app/CenterStatCard.tsx | 21 --------- src/components/app/StatCard.tsx | 46 +++++++------------ 6 files changed, 77 insertions(+), 70 deletions(-) create mode 100644 src/app/profile/components/ProfileStatCard.tsx delete mode 100644 src/components/app/CenterStatCard.tsx diff --git a/src/app/leaderboards/page.tsx b/src/app/leaderboards/page.tsx index 87dea58..80d7067 100644 --- a/src/app/leaderboards/page.tsx +++ b/src/app/leaderboards/page.tsx @@ -24,7 +24,7 @@ import { } from "@/components/ui/pagination"; import LeaderboardRow from "@/app/leaderboards/components/LeaderboardRow"; -import CenterStatCard from "@/components/app/CenterStatCard"; +import StatCard from "@/components/app/StatCard"; const globalLeaderboard = [ { @@ -191,14 +191,10 @@ export default function Leaderboards() { {/* Stats */}
- - - - + + + +
{/* Tabs + Filters */} diff --git a/src/app/profile/components/ProfileStatCard.tsx b/src/app/profile/components/ProfileStatCard.tsx new file mode 100644 index 0000000..23c438e --- /dev/null +++ b/src/app/profile/components/ProfileStatCard.tsx @@ -0,0 +1,46 @@ +import { LucideIcon } from "lucide-react"; + +interface StatCardProps { + label: string; + value: string; + icon: LucideIcon; + trend?: string; + index?: number; +} + +export default function ProfileStatCard({ + label, + value, + icon: Icon, + trend, + index = 0, +}: StatCardProps) { + return ( +
+
+
+ +
+ {trend && ( + + {trend} + + )} +
+

{value}

+

{label}

+
+ ); +} diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx index 879b001..1b4411f 100644 --- a/src/app/profile/page.tsx +++ b/src/app/profile/page.tsx @@ -7,7 +7,7 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; -import StatCard from "@/components/app/StatCard"; +import ProfileStatCard from "@/app/profile/components/ProfileStatCard"; export default function Profile() { const user = { @@ -64,26 +64,26 @@ export default function Profile() { {/* Stats */}
- - - - - - - - + + + +
{/* Filters */} diff --git a/src/components/app/CenterStatCard.tsx b/src/components/app/CenterStatCard.tsx deleted file mode 100644 index db47525..0000000 --- a/src/components/app/CenterStatCard.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; - -export default function CenterStatCard({ - icon: Icon, - label, - value, -}: { - icon: any; - label: string; - value: string; -}) { - return ( - - - - {value} -

{label}

-
-
- ); -} diff --git a/src/components/app/StatCard.tsx b/src/components/app/StatCard.tsx index ada35c5..963e918 100644 --- a/src/components/app/StatCard.tsx +++ b/src/components/app/StatCard.tsx @@ -1,35 +1,21 @@ -import { LucideIcon } from "lucide-react"; +import { Card, CardHeader, CardTitle } from "@/components/ui/card"; -interface StatCardProps { +export default function StatCard({ + icon: Icon, + label, + value, +}: { + icon: any; label: string; value: string; - icon: LucideIcon; - trend?: string; - index?: number; -} - -const StatCard = ({ label, value, icon: Icon, trend, index = 0 }: StatCardProps) => { +}) { return ( -
-
-
- -
- {trend && ( - - {trend} - - )} -
-

{value}

-

{label}

-
+ + + + {value} +

{label}

+
+
); -}; - -export default StatCard; +}