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 CacciariandCursor committed 2026-09-04 12:43:53 +02:00
1 parent fe1ac5434c
commit 438076c572
4 files changed
+12 -11

No files matched your search

@@ -3,7 +3,7 @@ import { Link } from "@tanstack/react-router";
import { Check, Eye, Loader2, Upload } from "lucide-react"; import { Check, Eye, Loader2, Upload } from "lucide-react";
import { toast } from "sonner"; import { toast } from "sonner";
import { cn } from "@/lib/utils"; 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 { Reveal } from "@/components/motion/Reveal";
import { import {
caricaFile, caricaFile,
@@ -302,7 +302,7 @@ export function ProfiloAmministrativo({
scrivi({ ...corrente, [campo]: path }); scrivi({ ...corrente, [campo]: path });
return ( return (
<Section <SezioneTendina
titolo="Dati per il tesseramento" titolo="Dati per il tesseramento"
indice={indice} indice={indice}
azione={<span className="text-xs font-bold tabular-nums text-muted-foreground">{perc}%</span>} azione={<span className="text-xs font-bold tabular-nums text-muted-foreground">{perc}%</span>}
@@ -374,7 +374,7 @@ export function ProfiloAmministrativo({
{sporco ? "Salva" : "Salvato"} {sporco ? "Salva" : "Salvato"}
</button> </button>
</div> </div>
</Section> </SezioneTendina>
); );
} }
+6 -1
View File
@@ -58,12 +58,14 @@ export function SezioneTendina({
titolo, titolo,
children, children,
anteprima, anteprima,
azione,
defaultAperta = false, defaultAperta = false,
indice = 0, indice = 0,
}: { }: {
titolo: string; titolo: string;
children: ReactNode; children: ReactNode;
anteprima?: ReactNode; anteprima?: ReactNode;
azione?: ReactNode;
defaultAperta?: boolean; defaultAperta?: boolean;
indice?: number; indice?: number;
}) { }) {
@@ -77,12 +79,15 @@ export function SezioneTendina({
aria-expanded={aperta} aria-expanded={aperta}
> >
<h2 className="font-display text-lg uppercase tracking-wide">{titolo}</h2> <h2 className="font-display text-lg uppercase tracking-wide">{titolo}</h2>
<span className="flex shrink-0 items-center gap-2">
{azione}
<ChevronDown <ChevronDown
className={cn( 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", aperta && "rotate-180",
)} )}
/> />
</span>
</button> </button>
{anteprima} {anteprima}
{aperta ? children : null} {aperta ? children : null}
-4
View File
@@ -2,7 +2,6 @@ import { createFileRoute, Link } from "@tanstack/react-router";
import { Flame, ChevronRight } from "lucide-react"; import { Flame, ChevronRight } from "lucide-react";
import { EventoCard, linkPerEvento } from "@/components/crapp/EventoCard"; import { EventoCard, linkPerEvento } from "@/components/crapp/EventoCard";
import { PromemoriaPalloni } from "@/components/crapp/PromemoriaPalloni"; import { PromemoriaPalloni } from "@/components/crapp/PromemoriaPalloni";
import { ScoutEntry } from "@/components/crapp/ScoutEntry";
import { Section, StatTile, TeamLogo } from "@/components/crapp/ui-bits"; import { Section, StatTile, TeamLogo } from "@/components/crapp/ui-bits";
import { CompletaProfilo } from "@/components/crapp/ProfiloAmministrativo"; import { CompletaProfilo } from "@/components/crapp/ProfiloAmministrativo";
import { Reveal } from "@/components/motion/Reveal"; import { Reveal } from "@/components/motion/Reveal";
@@ -117,9 +116,6 @@ function Index() {
Nessun impegno in programma. Nessun impegno in programma.
</p> </p>
)} )}
<div className="mt-3">
<ScoutEntry />
</div>
</Section> </Section>
<CompletaProfilo giocatoreId={giocatore.id} indice={2} /> <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 { toast } from "sonner";
import { Flame, Camera, Trash2, Bell, LogOut, ShieldCheck, Bug, Lightbulb } from "lucide-react"; import { Flame, Camera, Trash2, Bell, LogOut, ShieldCheck, Bug, Lightbulb } from "lucide-react";
import { cn } from "@/lib/utils"; 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 { Avatar } from "@/components/crapp/Avatar";
import { import {
caricaAvatar, caricaAvatar,
@@ -201,9 +201,9 @@ function Profilo() {
<SerieGriglia g={g} /> <SerieGriglia g={g} />
</Section> </Section>
<Section titolo="Collezione badge" indice={3}> <SezioneTendina titolo="Collezione badge" indice={3}>
<CollezioneBadge g={g} votiSocial={votiSocial.data ?? []} /> <CollezioneBadge g={g} votiSocial={votiSocial.data ?? []} />
</Section> </SezioneTendina>
<ProfiloAmministrativo giocatoreId={g.id} indice={4} /> <ProfiloAmministrativo giocatoreId={g.id} indice={4} />