From fc65914f5574b7244eedd797a5aa09c41061f230 Mon Sep 17 00:00:00 2001 From: Ivan Cacciari Date: Mon, 7 Sep 2026 18:35:35 +0200 Subject: [PATCH] Fa riempire tutta la larghezza alle tab di Campionato. Co-authored-by: Cursor --- src/components/crapp/BarraSottosezioni.tsx | 13 ++++++++++--- src/routes/classifica.tsx | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/crapp/BarraSottosezioni.tsx b/src/components/crapp/BarraSottosezioni.tsx index 1b12e2c..fa2988c 100644 --- a/src/components/crapp/BarraSottosezioni.tsx +++ b/src/components/crapp/BarraSottosezioni.tsx @@ -27,10 +27,13 @@ export function BarraSottosezioni({ voci, defaultId, variante = "pillole", + riempiLarghezza = false, }: { voci: VoceSottosezione[]; defaultId?: string; variante?: "pillole" | "sottolineatura"; + /** Tab a larghezza uguale che riempiono la barra (es. Campionato). */ + riempiLarghezza?: boolean; }) { const [attiva, setAttiva] = useState(defaultId ?? voci[0]?.id ?? ""); const direzione = useRef(0); @@ -80,7 +83,10 @@ export function BarraSottosezioni({ role="tablist" aria-label="Sottosezioni" className={cn( - "flex w-max min-w-full flex-nowrap", + "flex flex-nowrap", + riempiLarghezza + ? "w-full" + : "w-max min-w-full", sottolineatura ? "gap-1 px-2 py-1.5" : "snap-x snap-mandatory gap-1.5 px-5", )} > @@ -100,7 +106,8 @@ export function BarraSottosezioni({ vaiA(i); }} className={cn( - "min-h-11 shrink-0 touch-manipulation whitespace-nowrap text-sm font-bold uppercase tracking-wide transition-colors", + "min-h-11 touch-manipulation whitespace-nowrap text-sm font-bold uppercase tracking-wide transition-colors", + riempiLarghezza ? "min-w-0 flex-1" : "shrink-0", sottolineatura ? cn( "rounded-xl px-1 py-2.5 text-center", @@ -114,7 +121,7 @@ export function BarraSottosezioni({ ? "bg-accent text-accent-foreground shadow-pop" : "bg-secondary text-muted-foreground", ), - )} + )} > {v.label} diff --git a/src/routes/classifica.tsx b/src/routes/classifica.tsx index 5e6b914..0af3b2d 100644 --- a/src/routes/classifica.tsx +++ b/src/routes/classifica.tsx @@ -85,6 +85,7 @@ function Classifica() {