diff --git a/src/components/crapp/BarraSottosezioni.tsx b/src/components/crapp/BarraSottosezioni.tsx index 4b5dd98..091f543 100644 --- a/src/components/crapp/BarraSottosezioni.tsx +++ b/src/components/crapp/BarraSottosezioni.tsx @@ -7,8 +7,8 @@ export type VoceSottosezione = { id: string; label: string; contenuto: ReactNode; - /** Se true, non ripete il titolo della tab sopra il contenuto (es. Classifica già nella barra). */ - nascondiTitolo?: boolean; + /** Se true, il pannello è a tutta larghezza (niente padding), es. barra filtri Classifica. */ + aTuttoLarghezza?: boolean; }; /** Tween breve: evita molle + exit che tengono due pannelli in DOM insieme. */ @@ -19,9 +19,9 @@ const transizioneTab = { type: "tween" as const, duration: 0.16, ease: [0.25, 0. * pannello che mostra una sola sezione alla volta, cambiabile anche con * swipe sul contenuto. * - * `variante="sottolineatura"`: tab a testo con sottolineatura rossa e senza titolo - * ripetuto sotto la barra (Squadra e Classifica CSI). Default `pillole`: restano le - * pill e i titoli usati dal Profilo. + * `variante="sottolineatura"`: tab a testo con sottolineatura rossa (Squadra e Classifica + * CSI). Default `pillole`: restano le pill usate dal Profilo. Il titolo ripetuto sotto la + * barra non viene mai mostrato: l’etichetta è già nella tab. */ export function BarraSottosezioni({ voci, @@ -135,11 +135,8 @@ export function BarraSottosezioni({ initial={ridotto ? { opacity: 0 } : { opacity: 0, x: direzione.current * 20 }} animate={{ opacity: 1, x: 0 }} transition={ridotto ? { duration: 0.1 } : transizioneTab} - className={cn("touch-pan-y", voce.nascondiTitolo ? "px-0 pt-0 pb-4" : "px-5 py-4")} + className={cn("touch-pan-y", voce.aTuttoLarghezza ? "px-0 pt-0 pb-4" : "px-5 py-4")} > - {voce.nascondiTitolo || sottolineatura ? null : ( -

{voce.label}

- )} {voce.contenuto} diff --git a/src/components/crapp/EventoCard.tsx b/src/components/crapp/EventoCard.tsx index a4475f6..156bb60 100644 --- a/src/components/crapp/EventoCard.tsx +++ b/src/components/crapp/EventoCard.tsx @@ -54,6 +54,36 @@ export function EventoCard({ const isCompleanno = evento.tipo === "compleanno"; const passato = evento.data < dataOggi(); + function ChipPresenza({ s }: { s: Stato }) { + const meta = statoMeta[s]; + const attivo = stato === s; + return ( + + ); + } + if (isCompleanno) { return ( @@ -96,18 +126,6 @@ export function EventoCard({ - {linkTo && ( -
- - {linkTo.label} - -
- )} -
{evento.ora} @@ -123,37 +141,22 @@ export function EventoCard({ - {io ? ( + {io || linkTo ? (
- {stati.map((s) => { - const meta = statoMeta[s]; - const attivo = stato === s; - return ( - - ); - })} + {linkTo.label} + + ) : null} +
) : null}
diff --git a/src/routes/profilo.tsx b/src/routes/profilo.tsx index cde07c7..a4b9616 100644 --- a/src/routes/profilo.tsx +++ b/src/routes/profilo.tsx @@ -1,7 +1,7 @@ import { createFileRoute, Link } from "@tanstack/react-router"; import { useEffect, useRef, useState } from "react"; import { toast } from "sonner"; -import { Flame, Camera, Trash2, Bell, LogOut, ShieldCheck, Bug, Lightbulb } from "lucide-react"; +import { Flame, Trash2, Bell, LogOut, ShieldCheck, Bug, Lightbulb } from "lucide-react"; import { cn } from "@/lib/utils"; import { Card, PageHeader, StatTile, TeamLogo } from "@/components/crapp/ui-bits"; import { BarraSottosezioni } from "@/components/crapp/BarraSottosezioni"; @@ -140,24 +140,14 @@ function Profilo() {
-
- - - -
+ +