Mobile booking view
This commit is contained in:
@@ -68,6 +68,7 @@ export function BookingCreateDialog() {
|
||||
register,
|
||||
handleSubmit,
|
||||
reset,
|
||||
setFocus,
|
||||
formState: { errors, isValid },
|
||||
} = useForm<BookingForm>({
|
||||
resolver: zodResolver(bookingFormSchema),
|
||||
@@ -86,7 +87,13 @@ export function BookingCreateDialog() {
|
||||
setCourtId(selectedSlot?.courtId ?? '');
|
||||
setStartTime(selectedSlot?.startTime ?? '');
|
||||
reset();
|
||||
}, [isCreateBookingOpen, reset, selectedDate, selectedSlot]);
|
||||
|
||||
if (selectedSlot?.courtId && selectedSlot?.startTime) {
|
||||
requestAnimationFrame(() => {
|
||||
setFocus('customerName');
|
||||
});
|
||||
}
|
||||
}, [isCreateBookingOpen, reset, selectedDate, selectedSlot, setFocus]);
|
||||
|
||||
const sports = [...new Map(courts.map((court) => [court.sport.id, court.sport])).values()];
|
||||
const filteredCourts = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user