Skip to content

Commit 1500f22

Browse files
committed
Add color coding to dashboard stats cards
Introduced a 'color' property to each stats card and applied corresponding color and glow effects to card borders, icons, and text. This enhances visual distinction between different dashboard statistics.
1 parent 8534b5b commit 1500f22

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

app/dashboard/page.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ export default function DashboardPage() {
181181
})
182182

183183
const stats = [
184-
{ label: "Active Projects", value: loading ? "..." : counts.projects.toString(), icon: FolderKanban, change: `${counts.projects} total` },
185-
{ label: "Pending Todos", value: loading ? "..." : counts.todos.toString(), icon: ListTodo, change: "Active tasks" },
186-
{ label: "Active Milestones", value: loading ? "..." : counts.milestones.toString(), icon: GitBranch, change: "In progress" },
187-
{ label: "Upcoming Meetings", value: loading ? "..." : counts.meetings.toString(), icon: Calendar, change: "Scheduled" },
184+
{ label: "Active Projects", value: loading ? "..." : counts.projects.toString(), icon: FolderKanban, change: `${counts.projects} total`, color: "primary" },
185+
{ label: "Pending Todos", value: loading ? "..." : counts.todos.toString(), icon: ListTodo, change: "Active tasks", color: "cyan" },
186+
{ label: "Active Milestones", value: loading ? "..." : counts.milestones.toString(), icon: GitBranch, change: "In progress", color: "purple" },
187+
{ label: "Upcoming Meetings", value: loading ? "..." : counts.meetings.toString(), icon: Calendar, change: "Scheduled", color: "pink" },
188188
]
189189

190190
const recentProjects: Array<{ name: string; status: string; updated: string }> = []
@@ -463,15 +463,30 @@ export default function DashboardPage() {
463463
) : (
464464
stats.map((stat) => {
465465
const Icon = stat.icon
466+
const colorMap = {
467+
primary: "var(--primary)",
468+
cyan: "var(--accent-cyan)",
469+
purple: "var(--accent-purple)",
470+
pink: "var(--accent-pink)",
471+
}
472+
const glowMap = {
473+
primary: "hover:shadow-[0_0_20px_var(--primary)]",
474+
cyan: "hover:shadow-[0_0_20px_var(--accent-cyan)]",
475+
purple: "hover:shadow-[0_0_20px_var(--accent-purple)]",
476+
pink: "hover:shadow-[0_0_20px_var(--accent-pink)]",
477+
}
478+
const iconColor = colorMap[stat.color as keyof typeof colorMap]
479+
const glowEffect = glowMap[stat.color as keyof typeof glowMap]
480+
466481
return (
467-
<Card key={stat.label} className="border-border p-4 sm:p-6 bg-card hover:border-primary transition-colors">
482+
<Card key={stat.label} className={`border-border p-4 sm:p-6 bg-card hover:border-[${iconColor}] transition-all ${glowEffect}`}>
468483
<div className="flex items-start justify-between">
469484
<div className="space-y-1 sm:space-y-2">
470485
<p className="text-xs sm:text-sm font-medium text-muted-foreground">{stat.label}</p>
471486
<p className="text-2xl sm:text-3xl font-bold">{stat.value}</p>
472-
<p className="text-[10px] sm:text-xs text-primary">{stat.change}</p>
487+
<p className="text-[10px] sm:text-xs" style={{ color: iconColor }}>{stat.change}</p>
473488
</div>
474-
<Icon className="h-6 w-6 sm:h-8 sm:w-8 text-muted-foreground" />
489+
<Icon className="h-6 w-6 sm:h-8 sm:w-8" style={{ color: iconColor }} />
475490
</div>
476491
</Card>
477492
)

0 commit comments

Comments
 (0)