From 4248f3d37ff2cf138b0690da9d7399d3d621ea0f Mon Sep 17 00:00:00 2001 From: David Date: Thu, 29 Oct 2026 21:16:54 +0200 Subject: [PATCH] Suppliers: dark-mode contrast for monthly figures and coloured text; heading drawn in the view (React key warning) Co-Authored-By: Claude Sonnet 5.5 --- app/(dashboard)/expenses/suppliers-2/page.tsx | 10 ----- components/Suppliers2View.tsx | 43 +++++++++++-------- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/app/(dashboard)/expenses/suppliers-2/page.tsx b/app/(dashboard)/expenses/suppliers-2/page.tsx index 71e8ac6..3c3c895 100644 --- a/app/(dashboard)/expenses/suppliers-2/page.tsx +++ b/app/(dashboard)/expenses/suppliers-2/page.tsx @@ -1,4 +1,3 @@ -import { Store } from "lucide-react"; import { serverAuth } from "@/lib/pb"; import { buildSupplierSpend } from "@/lib/supplier-spend"; import { Suppliers2View } from "@/components/Suppliers2View"; @@ -48,15 +47,6 @@ export default async function Suppliers2Page() { rows={rows} year={now.getFullYear()} month={now.getMonth() + 1} - title={ -
-
-
-

Suppliers

-

Spend and payables per supplier

-
-
- } /> ); diff --git a/components/Suppliers2View.tsx b/components/Suppliers2View.tsx index 3de00ce..7681ed1 100644 --- a/components/Suppliers2View.tsx +++ b/components/Suppliers2View.tsx @@ -2,7 +2,7 @@ import { useState, useMemo } from "react"; import { useRouter } from "next/navigation"; -import { ChevronRight, Plus, Trash2, X, Loader2, Pencil } from "lucide-react"; +import { Store, ChevronRight, Plus, Trash2, X, Loader2, Pencil } from "lucide-react"; import { Sparkline } from "@/components/Sparkline"; import { MONTH_NAMES } from "@/lib/data"; import { ZAR, ZAR2 } from "@/lib/utils"; @@ -18,12 +18,11 @@ const monthLabel = (ym: string) => { }; export function Suppliers2View({ - rows, year, month, title, + rows, year, month, }: { rows: SupplierSpendRow[]; year: number; month: number; - title: React.ReactNode; }) { // Cash suppliers are paid on the spot — nothing to chase — so they stay out of the way until asked for. const [show, setShow] = useState<"account" | "all" | "cash">("account"); @@ -56,7 +55,13 @@ export function Suppliers2View({ return ( <>
- {title} +
+
+
+

Suppliers

+

Spend and payables per supplier

+
+
Spend in {MONTH_NAMES[month - 1]} {year}
@@ -79,7 +84,7 @@ export function Suppliers2View({
- {visible.length} supplier{visible.length !== 1 && "s"} + {visible.length} supplier{visible.length !== 1 && "s"} {show === "account" && cashN > 0 && ( {cashN} cash supplier{cashN !== 1 && "s"} hidden )} @@ -144,7 +149,7 @@ export function Suppliers2View({