diff --git a/src/components/crapp/BottomNav.tsx b/src/components/crapp/BottomNav.tsx index 01b5815..ad5a15b 100644 --- a/src/components/crapp/BottomNav.tsx +++ b/src/components/crapp/BottomNav.tsx @@ -1,12 +1,13 @@ import { Link } from "@tanstack/react-router"; -import { CalendarDays, Home, Trophy, User, Users } from "lucide-react"; +import { CalendarDays, Home, Trophy, Users } from "lucide-react"; +// Quattro voci e non cinque: il profilo sta in alto a destra +// nell'intestazione di ogni pagina, dove lo cerca chi arriva da iOS. const items = [ { to: "/", label: "Oggi", icon: Home }, { to: "/calendario", label: "Calendario", icon: CalendarDays }, { to: "/squadra", label: "Squadra", icon: Users }, { to: "/classifica", label: "Classifica", icon: Trophy }, - { to: "/profilo", label: "Profilo", icon: User }, ] as const; export function BottomNav() { @@ -25,7 +26,7 @@ export function BottomNav() { di sistema. Prima l'altezza dipendeva dai padding delle voci e nessuno poteva saperla da fuori. */} -
+
{items.map(({ to, label, icon: Icon }) => ( ; } -export function PageHeader({ titolo, sottotitolo }: { titolo: string; sottotitolo?: string }) { +/** + * Accesso al profilo in alto a destra: la BottomNav ha quattro voci e questa è + * l'unica porta verso `/profilo`. Sulla pagina del profilo si passa `azione` a + * `PageHeader` per rimetterci il logo — sarebbe un link a sé stessa. + */ +export function LinkProfilo() { + const g = useIo(); + if (!g) return ; + return ( + + + + ); +} + +export function PageHeader({ + titolo, + sottotitolo, + azione, +}: { + titolo: string; + sottotitolo?: string; + /** Sostituisce il link al profilo in alto a destra. */ + azione?: ReactNode; +}) { return (
@@ -43,7 +74,7 @@ export function PageHeader({ titolo, sottotitolo }: { titolo: string; sottotitol

{sottotitolo}

) : null}
- + {azione ?? }
); diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 81fc230..82467c1 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -2,7 +2,7 @@ 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 { Card, Section, StatTile, TeamLogo } from "@/components/crapp/ui-bits"; +import { Card, LinkProfilo, Section, StatTile } from "@/components/crapp/ui-bits"; import { CompletaProfilo } from "@/components/crapp/ProfiloAmministrativo"; import { Reveal } from "@/components/motion/Reveal"; import { Barra } from "@/components/motion/Barra"; @@ -72,7 +72,7 @@ function Index() {

CRAP Volley

- +
diff --git a/src/routes/profilo.tsx b/src/routes/profilo.tsx index c7900a3..9103f7c 100644 --- a/src/routes/profilo.tsx +++ b/src/routes/profilo.tsx @@ -3,7 +3,14 @@ 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 { Card, PageHeader, Section, SezioneTendina, StatTile } from "@/components/crapp/ui-bits"; +import { + Card, + PageHeader, + Section, + SezioneTendina, + StatTile, + TeamLogo, +} from "@/components/crapp/ui-bits"; import { Avatar } from "@/components/crapp/Avatar"; import { caricaAvatar, @@ -115,7 +122,12 @@ function Profilo() { return ( <> - + {/* Qui il link al profilo sarebbe un link a sé stessa: torna il logo. */} + } + />