regionals on tournament form

This commit is contained in:
yohlo
2026-02-09 23:44:07 -06:00
parent 63853f22de
commit 9ed054e5d0
3 changed files with 10 additions and 1 deletions

View File

@@ -87,6 +87,7 @@ const ManageTournament = ({ tournamentId }: ManageTournamentProps) => {
start_time: tournament.start_time, start_time: tournament.start_time,
enroll_time: tournament.enroll_time, enroll_time: tournament.enroll_time,
end_time: tournament.end_time, end_time: tournament.end_time,
regional: tournament.regional,
}} }}
close={closeEditTournament} close={closeEditTournament}
/> />

View File

@@ -1,4 +1,4 @@
import { FileInput, Stack, TextInput, Textarea } from "@mantine/core"; import { FileInput, Stack, TextInput, Textarea, Checkbox } from "@mantine/core";
import { useForm, UseFormInput } from "@mantine/form"; import { useForm, UseFormInput } from "@mantine/form";
import { LinkIcon } from "@phosphor-icons/react"; import { LinkIcon } from "@phosphor-icons/react";
import SlidePanel, { SlidePanelField } from "@/components/sheet/slide-panel"; import SlidePanel, { SlidePanelField } from "@/components/sheet/slide-panel";
@@ -35,6 +35,7 @@ const TournamentForm = ({
enroll_time: initialValues?.enroll_time || "", enroll_time: initialValues?.enroll_time || "",
end_time: initialValues?.end_time || "", end_time: initialValues?.end_time || "",
logo: undefined, logo: undefined,
regional: initialValues?.regional || false,
}, },
onSubmitPreventDefault: "always", onSubmitPreventDefault: "always",
validate: { validate: {
@@ -150,6 +151,12 @@ const TournamentForm = ({
minRows={3} minRows={3}
/> />
<Checkbox
label="Regional Tournament"
key={form.key("regional")}
{...form.getInputProps("regional", { type: "checkbox" })}
/>
<FileInput <FileInput
key={form.key("logo")} key={form.key("logo")}
accept="image/png,image/jpeg,image/gif,image/jpg" accept="image/png,image/jpeg,image/gif,image/jpg"

View File

@@ -63,6 +63,7 @@ export const tournamentInputSchema = z.object({
enroll_time: z.string(), enroll_time: z.string(),
start_time: z.string(), start_time: z.string(),
end_time: z.string().optional(), end_time: z.string().optional(),
regional: z.boolean().optional().default(false),
}); });
export type TournamentInput = z.infer<typeof tournamentInputSchema>; export type TournamentInput = z.infer<typeof tournamentInputSchema>;