From 033c45df4d286fd9e40a7791cd8d710fccf9300f Mon Sep 17 00:00:00 2001 From: Ivan Cacciari Date: Sat, 5 Sep 2026 22:38:48 +0200 Subject: [PATCH] Apre Tesseramento dal widget Completa profilo in home. Co-authored-by: Cursor --- docs/CHANGELOG.md | 2 ++ docs/modules/profilo-giocatore.md | 3 +++ src/components/crapp/ProfiloAmministrativo.tsx | 6 +++++- src/routes/profilo.tsx | 16 +++++++++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d278178..90babd9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,8 @@ qui: sta in [ROADMAP.md](ROADMAP.md). - L’interruttore in Impostazioni non è più «Notifiche turno palloni»: iscrive il dispositivo a tutte le push (palloni, solleciti) e alle smart in app. Testo e docs aggiornati. +- Il widget Home «Completa il tuo profilo» apre direttamente la tab Tesseramento + (`/profilo?tab=tesseramento`). ### Revisione dell'interfaccia: accessibilità, movimento, peso diff --git a/docs/modules/profilo-giocatore.md b/docs/modules/profilo-giocatore.md index aa8f38e..06a9c4b 100644 --- a/docs/modules/profilo-giocatore.md +++ b/docs/modules/profilo-giocatore.md @@ -67,6 +67,9 @@ Viene mostrata una barra di avanzamento (esempio: _Profilo completato — 85%_), Quando tutte le sezioni sono complete il widget scompare automaticamente. +Il tap apre Profilo sulla sottosezione **Tesseramento** (`/profilo?tab=tesseramento`), non +sulla tab Stagione. + ## Profilo Il profilo viene suddiviso in sette aree. diff --git a/src/components/crapp/ProfiloAmministrativo.tsx b/src/components/crapp/ProfiloAmministrativo.tsx index ab17b0d..5dc1cb4 100644 --- a/src/components/crapp/ProfiloAmministrativo.tsx +++ b/src/components/crapp/ProfiloAmministrativo.tsx @@ -409,7 +409,11 @@ export function CompletaProfilo({ return ( - +
Completa il tuo profilo diff --git a/src/routes/profilo.tsx b/src/routes/profilo.tsx index b0a1e88..85e16cd 100644 --- a/src/routes/profilo.tsx +++ b/src/routes/profilo.tsx @@ -29,7 +29,18 @@ import { esci } from "@/lib/auth"; import { useIsAdmin } from "@/lib/ruoli"; import { Reveal } from "@/components/motion/Reveal"; +const TAB_PROFILO = ["stagione", "badge", "tesseramento", "impostazioni"] as const; +type TabProfilo = (typeof TAB_PROFILO)[number]; + +function isTabProfilo(v: unknown): v is TabProfilo { + return typeof v === "string" && (TAB_PROFILO as readonly string[]).includes(v); +} + export const Route = createFileRoute("/profilo")({ + validateSearch: (search: Record): { tab?: TabProfilo } => { + const tab = isTabProfilo(search["tab"]) ? search["tab"] : undefined; + return tab ? { tab } : {}; + }, head: () => ({ meta: [ { title: "Profilo giocatore — CrAPP" }, @@ -48,6 +59,8 @@ export const Route = createFileRoute("/profilo")({ }); function Profilo() { + const { tab } = Route.useSearch(); + const tabIniziale = tab ?? "stagione"; const votiSocial = useVotiSocial(); const g = useIo(); const admin = useIsAdmin(); @@ -178,7 +191,8 @@ function Profilo() {