Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 73 additions & 6 deletions src/app/(app)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
return <NotConfigured />;
}

const {
data: { user },
} = await sb.auth.getUser();
const { data } = await sb.auth.getUser();
const user = data?.user;
if (!user) redirect('/');

const service = getServiceSupabase();
Expand Down Expand Up @@ -56,9 +55,77 @@
</header>

{/* Stats Row */}
<Suspense fallback={<StatsSkeleton />}>
<StatsRow userId={user.id} profile={profile} />
</Suspense>
<div className="mb-16 grid grid-cols-1 gap-12 md:grid-cols-4">
{/* Level Progress */}
<div>
<div className="mb-4 text-[11px] uppercase tracking-widest text-zinc-500">
LEVEL PROGRESS
</div>
<div className="flex items-center gap-4">
<div className="border border-zinc-700 px-3 py-2 font-serif text-xl text-zinc-300">
L{level}

Check failure on line 66 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'level'.
</div>
<div className="flex-1">
<div className="mb-2 h-1.5 w-full overflow-hidden bg-[#1c2128]">
<div
className="h-full bg-[#10b981]"
style={{ width: `${levelProgressPct(xp, level)}%` }}

Check failure on line 72 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'level'.

Check failure on line 72 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'xp'.

Check failure on line 72 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'levelProgressPct'.
/>
</div>
<div className="text-[10px] uppercase tracking-widest text-zinc-500">
{xp.toLocaleString()} / {(xp + needed).toLocaleString()} XP TO L{nextLevel}

Check failure on line 76 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'nextLevel'.

Check failure on line 76 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'needed'.

Check failure on line 76 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'xp'.

Check failure on line 76 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'xp'.
</div>
</div>
</div>
</div>

{/* Total Merges */}
<div>
<div className="mb-4 text-[11px] uppercase tracking-widest text-zinc-500">
TOTAL MERGES
</div>
<div className="flex items-end gap-2">
<span className="font-serif text-4xl leading-none">
{(merges ?? 0).toString().padStart(2, '0')}

Check failure on line 89 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'merges'.
</span>
<TrendingUp className="mb-1 h-4 w-4 text-[#10b981]" />

Check failure on line 91 in src/app/(app)/dashboard/page.tsx

View workflow job for this annotation

GitHub Actions / check

Cannot find name 'TrendingUp'.
</div>
</div>

{/* Mentor Points */}
<div>
<div className="mb-4 text-[11px] uppercase tracking-widest text-zinc-500">
MENTOR POINTS
</div>
<div className="flex items-end gap-2">
<span className="font-serif text-4xl leading-none">
{mentorPoints.toLocaleString()}
</span>
<Box className="mb-1 h-5 w-5 text-zinc-400" />
</div>
</div>

{/* Current Streak */}
<div>
<div className="mb-4 text-[11px] uppercase tracking-widest text-zinc-500">
CURRENT STREAK
</div>
<div className="flex items-end gap-2">
{streak && streak > 0 ? (
<>
<span className="font-serif text-4xl leading-none">
{streak.toString().padStart(2, '0')}
</span>
<span className="mb-1 text-[10px] uppercase tracking-widest text-zinc-500">
DAYS 🔥
</span>
</>
) : (
<span className="font-serif text-4xl leading-none">NO STREAK</span>
)}
</div>
</div>
</div>

{/* Main Columns */}
<div className="grid grid-cols-1 gap-16 lg:grid-cols-2">
Expand Down
Loading