feat: redesign weight summary legend and add currency selector

Redesign WeightSummaryCard stats from a disconnected 4-column grid to a
compact legend-style list with color dots, percentages, and a divider
before the total row. Switch chart and legend colors to a neutral gray
palette.

Add a currency selector to settings (USD, EUR, GBP, JPY, CAD, AUD) that
changes the displayed symbol across the app. This is visual only — no
value conversion is performed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 20:33:07 +01:00
parent 4cb356d6b0
commit 9647f5759d
14 changed files with 470 additions and 145 deletions

View File

@@ -1,4 +1,5 @@
import { useNavigate } from "@tanstack/react-router";
import { useCurrency } from "../hooks/useCurrency";
import { formatPrice } from "../lib/formatters";
import { LucideIcon } from "../lib/iconData";
@@ -22,10 +23,11 @@ function formatDate(iso: string): string {
function formatPriceRange(
min: number | null,
max: number | null,
currency: Parameters<typeof formatPrice>[1],
): string | null {
if (min == null && max == null) return null;
if (min === max) return formatPrice(min);
return `${formatPrice(min)} - ${formatPrice(max)}`;
if (min === max) return formatPrice(min, currency);
return `${formatPrice(min, currency)} - ${formatPrice(max, currency)}`;
}
export function ThreadCard({
@@ -40,9 +42,10 @@ export function ThreadCard({
categoryIcon,
}: ThreadCardProps) {
const navigate = useNavigate();
const currency = useCurrency();
const isResolved = status === "resolved";
const priceRange = formatPriceRange(minPriceCents, maxPriceCents);
const priceRange = formatPriceRange(minPriceCents, maxPriceCents, currency);
return (
<button