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" && (