Apre Tesseramento dal widget Completa profilo in home.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Cacciari
2026-09-05 22:38:48 +02:00
co-authored by Cursor
parent 2345a45f14
commit 033c45df4d
4 changed files with 25 additions and 2 deletions
@@ -409,7 +409,11 @@ export function CompletaProfilo({
return (
<Reveal indice={indice} className="px-5 pt-4">
<Link to="/profilo" className="premi block rounded-3xl bg-card p-4 shadow-card">
<Link
to="/profilo"
search={{ tab: "tesseramento" }}
className="premi block rounded-3xl bg-card p-4 shadow-card"
>
<div className="flex items-center justify-between gap-3">
<span className="font-display text-sm uppercase tracking-wide">
Completa il tuo profilo
+15 -1
View File
@@ -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<string, unknown>): { 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() {
</Reveal>
<BarraSottosezioni
defaultId="stagione"
key={tabIniziale}
defaultId={tabIniziale}
voci={[
{
id: "stagione",