Rende collassabili badge e tesseramento nel profilo e toglie Scout Live dalla home.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Cacciari
2026-09-04 12:43:53 +02:00
co-authored by Cursor
parent fe1ac5434c
commit 438076c572
4 changed files with 17 additions and 16 deletions
@@ -3,7 +3,7 @@ import { Link } from "@tanstack/react-router";
import { Check, Eye, Loader2, Upload } from "lucide-react";
import { toast } from "sonner";
import { cn } from "@/lib/utils";
import { Section } from "@/components/crapp/ui-bits";
import { SezioneTendina } from "@/components/crapp/ui-bits";
import { Reveal } from "@/components/motion/Reveal";
import {
caricaFile,
@@ -302,7 +302,7 @@ export function ProfiloAmministrativo({
scrivi({ ...corrente, [campo]: path });
return (
<Section
<SezioneTendina
titolo="Dati per il tesseramento"
indice={indice}
azione={<span className="text-xs font-bold tabular-nums text-muted-foreground">{perc}%</span>}
@@ -374,7 +374,7 @@ export function ProfiloAmministrativo({
{sporco ? "Salva" : "Salvato"}
</button>
</div>
</Section>
</SezioneTendina>
);
}
+6 -1
View File
@@ -58,12 +58,14 @@ export function SezioneTendina({
titolo,
children,
anteprima,
azione,
defaultAperta = false,
indice = 0,
}: {
titolo: string;
children: ReactNode;
anteprima?: ReactNode;
azione?: ReactNode;
defaultAperta?: boolean;
indice?: number;
}) {
@@ -77,12 +79,15 @@ export function SezioneTendina({
aria-expanded={aperta}
>
<h2 className="font-display text-lg uppercase tracking-wide">{titolo}</h2>
<span className="flex shrink-0 items-center gap-2">
{azione}
<ChevronDown
className={cn(
"h-4 w-4 shrink-0 text-muted-foreground transition-transform",
"h-4 w-4 text-muted-foreground transition-transform",
aperta && "rotate-180",
)}
/>
</span>
</button>
{anteprima}
{aperta ? children : null}
-4
View File
@@ -2,7 +2,6 @@ import { createFileRoute, Link } from "@tanstack/react-router";
import { Flame, ChevronRight } from "lucide-react";
import { EventoCard, linkPerEvento } from "@/components/crapp/EventoCard";
import { PromemoriaPalloni } from "@/components/crapp/PromemoriaPalloni";
import { ScoutEntry } from "@/components/crapp/ScoutEntry";
import { Section, StatTile, TeamLogo } from "@/components/crapp/ui-bits";
import { CompletaProfilo } from "@/components/crapp/ProfiloAmministrativo";
import { Reveal } from "@/components/motion/Reveal";
@@ -117,9 +116,6 @@ function Index() {
Nessun impegno in programma.
</p>
)}
<div className="mt-3">
<ScoutEntry />
</div>
</Section>
<CompletaProfilo giocatoreId={giocatore.id} indice={2} />
+3 -3
View File
@@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
import { Flame, Camera, Trash2, Bell, LogOut, ShieldCheck, Bug, Lightbulb } from "lucide-react";
import { cn } from "@/lib/utils";
import { PageHeader, Section, StatTile } from "@/components/crapp/ui-bits";
import { PageHeader, Section, SezioneTendina, StatTile } from "@/components/crapp/ui-bits";
import { Avatar } from "@/components/crapp/Avatar";
import {
caricaAvatar,
@@ -201,9 +201,9 @@ function Profilo() {
<SerieGriglia g={g} />
</Section>
<Section titolo="Collezione badge" indice={3}>
<SezioneTendina titolo="Collezione badge" indice={3}>
<CollezioneBadge g={g} votiSocial={votiSocial.data ?? []} />
</Section>
</SezioneTendina>
<ProfiloAmministrativo giocatoreId={g.id} indice={4} />