From d2c8ce5ccba23dface229cc406c7ce94074e7f83 Mon Sep 17 00:00:00 2001 From: spark Date: Wed, 4 Nov 2026 14:56:09 +0000 Subject: [PATCH] fix(ui): keep the squad picker off a generic event until asked --- apps/app/src/library/EventForm.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/app/src/library/EventForm.tsx b/apps/app/src/library/EventForm.tsx index 7d78bc0..3dcd87d 100644 --- a/apps/app/src/library/EventForm.tsx +++ b/apps/app/src/library/EventForm.tsx @@ -69,6 +69,7 @@ export function EventForm({ api, orgId, onClose, onCreated }: { api: ApiClient; const [match, setMatch] = useState(null); /** Generic event (a training): borrow this match's squads without becoming the match. */ const [squadMatch, setSquadMatch] = useState(null); + const [showSquad, setShowSquad] = useState(false); const [kind, setKind] = useState("match"); const [caption, setCaption] = useState(""); const fields: readonly (typeof FIELDS)[number][] = kind === "match" ? FIELDS : OTHER_FIELDS; @@ -150,10 +151,18 @@ export function EventForm({ api, orgId, onClose, onCreated }: { api: ApiClient; {kind === "match" && setMatch(null)} />} {kind === "other" && ( -
-

{t.eventForm.squadFromMatch}

- setSquadMatch(null)} /> -

{t.eventForm.squadFromMatchHelp}

+
+ {!showSquad && !squadMatch ? ( + + ) : ( + <> +

{t.eventForm.squadFromMatch}

+ { setSquadMatch(null); setShowSquad(false); }} /> +

{t.eventForm.squadFromMatchHelp}

+ + )}
)} {kind === "other" && (