UI: Section-aware sidebar active colors - gold for Pro Tier, teal for AI Coach in light mode

This commit is contained in:
2026-08-07 11:14:24 +05:30
parent 5f1f6ee156
commit 117e0c4e2e

View File

@@ -95,9 +95,10 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
</div> </div>
</div> </div>
<NavItem href="/dashboard" icon={<LayoutDashboard size={17} />} label="Overview" active={pathname === "/dashboard"} /> <NavItem section="pro" href="/dashboard" icon={<LayoutDashboard size={17} />} label="Overview" active={pathname === "/dashboard"} />
<NavItem href="/dashboard/leaderboard" icon={<Trophy size={17} />} label="Leaderboard" active={pathname.startsWith("/dashboard/leaderboard")} /> <NavItem section="pro" href="/dashboard/leaderboard" icon={<Trophy size={17} />} label="Leaderboard" active={pathname.startsWith("/dashboard/leaderboard")} />
<NavItem <NavItem
section="pro"
href="/dashboard/progress" href="/dashboard/progress"
icon={<BarChart3 size={17} />} icon={<BarChart3 size={17} />}
label="Syllabus Tracker" label="Syllabus Tracker"
@@ -105,6 +106,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("chapter-wise-progress-tracking")} isLocked={!hasAccessTo("chapter-wise-progress-tracking")}
/> />
<NavItem <NavItem
section="pro"
href="/dashboard/cbt" href="/dashboard/cbt"
icon={<CheckSquare size={17} />} icon={<CheckSquare size={17} />}
label="Mock Tests (CBT)" label="Mock Tests (CBT)"
@@ -112,6 +114,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("weekly-test-series")} isLocked={!hasAccessTo("weekly-test-series")}
/> />
<NavItem <NavItem
section="pro"
href="/dashboard/materials" href="/dashboard/materials"
icon={<BookOpen size={17} />} icon={<BookOpen size={17} />}
label="Quick Notes" label="Quick Notes"
@@ -119,6 +122,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("detailed-performance-analytics")} isLocked={!hasAccessTo("detailed-performance-analytics")}
/> />
<NavItem <NavItem
section="pro"
href="/dashboard/analytics" href="/dashboard/analytics"
icon={<LineChart size={17} />} icon={<LineChart size={17} />}
label="Performance Analytics" label="Performance Analytics"
@@ -126,6 +130,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("detailed-performance-analytics")} isLocked={!hasAccessTo("detailed-performance-analytics")}
/> />
<NavItem <NavItem
section="pro"
href="/dashboard/community" href="/dashboard/community"
icon={<School size={17} />} icon={<School size={17} />}
label="Doubt Forum" label="Doubt Forum"
@@ -146,6 +151,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
</div> </div>
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/tutor" href="/dashboard/ai-coach/tutor"
icon={<BrainCircuitIcon />} icon={<BrainCircuitIcon />}
label="AI Tutor" label="AI Tutor"
@@ -153,6 +159,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("ai-tutor-chat")} isLocked={!hasAccessTo("ai-tutor-chat")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/cbt-dpp" href="/dashboard/ai-coach/cbt-dpp"
icon={<Zap size={17} />} icon={<Zap size={17} />}
label="PrepPilot AI" label="PrepPilot AI"
@@ -160,6 +167,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("ai-tutor-chat")} isLocked={!hasAccessTo("ai-tutor-chat")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/readiness" href="/dashboard/ai-coach/readiness"
icon={<Gauge size={17} />} icon={<Gauge size={17} />}
label="Exam Readiness" label="Exam Readiness"
@@ -167,6 +175,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("detailed-performance-analytics")} isLocked={!hasAccessTo("detailed-performance-analytics")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/college-predictor" href="/dashboard/ai-coach/college-predictor"
icon={<School size={17} />} icon={<School size={17} />}
label="College Predictor" label="College Predictor"
@@ -174,6 +183,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("college-predictor")} isLocked={!hasAccessTo("college-predictor")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/strategy" href="/dashboard/ai-coach/strategy"
icon={<Target size={17} />} icon={<Target size={17} />}
label="Exam Strategy" label="Exam Strategy"
@@ -181,6 +191,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("exam-day-strategy")} isLocked={!hasAccessTo("exam-day-strategy")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/study-plan" href="/dashboard/ai-coach/study-plan"
icon={<Calendar size={17} />} icon={<Calendar size={17} />}
label="AI Study Plan" label="AI Study Plan"
@@ -188,6 +199,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("personalized-study-plan")} isLocked={!hasAccessTo("personalized-study-plan")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/time-optimization" href="/dashboard/ai-coach/time-optimization"
icon={<Clock size={17} />} icon={<Clock size={17} />}
label="Time Optimization" label="Time Optimization"
@@ -195,6 +207,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("personalized-study-plan")} isLocked={!hasAccessTo("personalized-study-plan")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/heatmap" href="/dashboard/ai-coach/heatmap"
icon={<Flame size={17} />} icon={<Flame size={17} />}
label="Mistake Heatmap" label="Mistake Heatmap"
@@ -202,6 +215,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("ai-mistake-tracking")} isLocked={!hasAccessTo("ai-mistake-tracking")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/weekly-progress" href="/dashboard/ai-coach/weekly-progress"
icon={<Activity size={17} />} icon={<Activity size={17} />}
label="Weekly Progress" label="Weekly Progress"
@@ -209,6 +223,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
isLocked={!hasAccessTo("detailed-performance-analytics")} isLocked={!hasAccessTo("detailed-performance-analytics")}
/> />
<NavItem <NavItem
section="ai"
href="/dashboard/ai-coach/mistakes" href="/dashboard/ai-coach/mistakes"
icon={<BrainCircuit size={17} />} icon={<BrainCircuit size={17} />}
label="Mistake Analyzer" label="Mistake Analyzer"
@@ -332,28 +347,49 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
) )
} }
function NavItem({ href, icon, label, active, isLocked }: { href: string, icon: React.ReactNode, label: string, active?: boolean, isLocked?: boolean }) { function NavItem({ href, icon, label, active, isLocked, section }: { href: string, icon: React.ReactNode, label: string, active?: boolean, isLocked?: boolean, section?: "pro" | "ai" }) {
// Section-aware active color tokens (light mode only, dark mode falls back to cyan)
const activeClasses = active
? section === "pro"
? "bg-yellow-50 light:bg-yellow-50 text-yellow-700 dark:bg-[#00F0FF]/10 dark:text-[#00F0FF] font-semibold border border-yellow-300/60 dark:border-[#00F0FF]/20 shadow-[0_0_12px_-4px_rgba(234,179,8,0.2)] dark:shadow-[0_0_12px_-4px_rgba(0,240,255,0.3)]"
: section === "ai"
? "bg-cyan-50 dark:bg-[#00F0FF]/10 text-cyan-800 dark:text-[#00F0FF] font-semibold border border-cyan-300/60 dark:border-[#00F0FF]/20 shadow-[0_0_12px_-4px_rgba(6,182,212,0.2)] dark:shadow-[0_0_12px_-4px_rgba(0,240,255,0.3)]"
: "bg-[#00F0FF]/10 text-[#00F0FF] font-semibold border border-[#00F0FF]/20 shadow-[0_0_12px_-4px_rgba(0,240,255,0.3)]"
: isLocked
? "text-muted-foreground/40 cursor-not-allowed border border-transparent"
: "text-muted-foreground/80 hover:bg-secondary/60 hover:text-foreground border border-transparent hover:border-border/40"
const iconActiveClass = active
? section === "pro"
? "text-yellow-600 dark:text-[#00F0FF]"
: section === "ai"
? "text-cyan-700 dark:text-[#00F0FF]"
: "text-[#00F0FF]"
: isLocked
? "text-muted-foreground/30"
: "text-muted-foreground/60 group-hover:text-foreground/80"
const activeBarClass = active
? section === "pro"
? "w-1 h-4 rounded-full bg-yellow-500 dark:bg-[#00F0FF] shrink-0 shadow-[0_0_6px_rgba(234,179,8,0.6)] dark:shadow-[0_0_6px_rgba(0,240,255,0.8)]"
: section === "ai"
? "w-1 h-4 rounded-full bg-cyan-600 dark:bg-[#00F0FF] shrink-0 shadow-[0_0_6px_rgba(6,182,212,0.6)] dark:shadow-[0_0_6px_rgba(0,240,255,0.8)]"
: "w-1 h-4 rounded-full bg-[#00F0FF] shrink-0 shadow-[0_0_6px_rgba(0,240,255,0.8)]"
: ""
return ( return (
<Link <Link
href={isLocked ? "#" : href} href={isLocked ? "#" : href}
className={`group flex items-center justify-between px-3 py-2 rounded-xl transition-all duration-200 ${ className={`group flex items-center justify-between px-3 py-2 rounded-xl transition-all duration-200 ${activeClasses}`}
active
? "bg-[#00F0FF]/10 text-[#00F0FF] font-semibold border border-[#00F0FF]/20 shadow-[0_0_12px_-4px_rgba(0,240,255,0.3)]"
: isLocked
? "text-muted-foreground/40 cursor-not-allowed border border-transparent"
: "text-muted-foreground/80 hover:bg-secondary/60 hover:text-foreground border border-transparent hover:border-border/40"
}`}
> >
<div className="flex items-center gap-2.5"> <div className="flex items-center gap-2.5">
<span className={`transition-all duration-200 ${ <span className={`transition-all duration-200 ${iconActiveClass}`}>
active ? "text-[#00F0FF]" : isLocked ? "text-muted-foreground/30" : "text-muted-foreground/60 group-hover:text-foreground/80"
}`}>
{icon} {icon}
</span> </span>
<span className="text-[13px] font-medium tracking-[-0.01em]">{label}</span> <span className="text-[13px] font-medium tracking-[-0.01em]">{label}</span>
</div> </div>
{isLocked && <Lock size={11} className="text-muted-foreground/30 shrink-0" />} {isLocked && <Lock size={11} className="text-muted-foreground/30 shrink-0" />}
{active && <span className="w-1 h-4 rounded-full bg-[#00F0FF] shrink-0 shadow-[0_0_6px_rgba(0,240,255,0.8)]"></span>} {active && <span className={activeBarClass}></span>}
</Link> </Link>
) )
} }