From ab41ede160c5936aa6e09c125ba3d0877eb3916e Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Mon, 30 Mar 2026 22:58:09 -0700 Subject: [PATCH] feat: add variant scoring controls to EditTournamentForm --- src/components/EditTournamentForm.tsx | 61 +++++++++++++++++++++------ 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/src/components/EditTournamentForm.tsx b/src/components/EditTournamentForm.tsx index 1641eae..6852922 100644 --- a/src/components/EditTournamentForm.tsx +++ b/src/components/EditTournamentForm.tsx @@ -19,16 +19,19 @@ export default function EditTournamentForm({ tournament }: EditTournamentFormPro format: tournament.format, status: tournament.status, maxParticipants: tournament.maxParticipants?.toString() || "", + targetScore: tournament.targetScore?.toString() || "", + allowTies: tournament.allowTies || false, }) const [error, setError] = useState("") const [success, setSuccess] = useState("") const [isLoading, setIsLoading] = useState(false) const handleChange = (e: React.ChangeEvent) => { - const { name, value } = e.target + const { name, value, type } = e.target + const checked = (e.target as HTMLInputElement).checked setFormData(prev => ({ ...prev, - [name]: value, + [name]: type === 'checkbox' ? checked : value, })) } @@ -48,6 +51,7 @@ export default function EditTournamentForm({ tournament }: EditTournamentFormPro ...formData, maxParticipants: formData.maxParticipants ? parseInt(formData.maxParticipants) : null, eventDate: formData.eventDate ? new Date(formData.eventDate).toISOString() : null, + targetScore: formData.targetScore ? parseInt(formData.targetScore) : null, }), }) @@ -186,19 +190,50 @@ export default function EditTournamentForm({ tournament }: EditTournamentFormPro +
+
+ + +
+ +
+ + +
+
+
-