Skip to content

Commit 0caeb87

Browse files
Merge pull request #48 from pineapplestrikesback/feature/weekly-volume-compact
Move weekly volume above activity chart
2 parents dde1578 + 9ec6f58 commit 0caeb87

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

src/ui/components/TotalVolumeCard.tsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function TotalVolumeCard(): React.ReactElement {
1313
);
1414

1515
if (isLoading) {
16-
return <div className="h-32 animate-pulse rounded-lg bg-primary-500" />;
16+
return <div className="min-h-[72px] animate-pulse rounded-lg bg-zinc-900" />;
1717
}
1818

1919
const percentage = totalGoal > 0 ? Math.min((totalVolume / totalGoal) * 100, 100) : 0;
@@ -27,23 +27,32 @@ export function TotalVolumeCard(): React.ReactElement {
2727
};
2828

2929
return (
30-
<div className="rounded-lg bg-surface-raised p-6">
31-
<h3 className="mb-2 text-lg font-semibold text-white">Total Weekly Volume</h3>
32-
33-
<div className="mb-2 flex items-baseline gap-2">
34-
<span className="text-4xl font-bold text-white">{volumeDisplay}</span>
35-
<span className="text-lg text-primary-200">sets</span>
30+
<div className="min-h-[72px] rounded-lg border-2 border-zinc-800 bg-zinc-950 px-4 py-3">
31+
<div className="flex items-center justify-between gap-3">
32+
<div>
33+
<p className="text-xs font-bold uppercase tracking-wider text-zinc-400">
34+
Total Weekly Volume
35+
</p>
36+
<div className="mt-1 flex items-baseline gap-2">
37+
<span className="text-2xl font-black text-white">{volumeDisplay}</span>
38+
<span className="text-xs font-semibold uppercase tracking-wider text-zinc-400">
39+
sets
40+
</span>
41+
</div>
42+
</div>
43+
<div className="text-right">
44+
<p className="text-xs font-semibold text-zinc-400">Target {totalGoal}</p>
45+
<p className="text-[10px] uppercase tracking-wider text-zinc-600">sets/week</p>
46+
</div>
3647
</div>
3748

3849
{/* Progress Bar */}
39-
<div className="mb-2 h-3 overflow-hidden rounded-full bg-primary-800">
50+
<div className="mt-2 h-2 overflow-hidden rounded-full bg-zinc-800">
4051
<div
4152
className={`h-full rounded-full transition-all duration-500 ${getProgressBarClass()}`}
4253
style={{ width: `${percentage}%` }}
4354
/>
4455
</div>
45-
46-
<p className="text-sm text-primary-200">Target: {totalGoal} sets/week</p>
4756
</div>
4857
);
4958
}

src/ui/pages/Dashboard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ export function Dashboard(): React.ReactElement {
7777
<h2 className="text-2xl font-bold text-white">Workout Overview</h2>
7878
</div>
7979

80+
{/* Total Weekly Volume */}
81+
<TotalVolumeCard />
82+
8083
{/* Weekly Activity Chart */}
8184
<WeeklyActivityChart />
8285

@@ -95,8 +98,6 @@ export function Dashboard(): React.ReactElement {
9598
)}
9699
</div>
97100

98-
{/* Total Volume */}
99-
<TotalVolumeCard />
100101
</div>
101102
);
102103
}

0 commit comments

Comments
 (0)