Skip to content

Commit

Permalink
disable on loading
Browse files Browse the repository at this point in the history
  • Loading branch information
SomayChauhan committed Jan 21, 2025
1 parent 025c387 commit 48fd326
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/features/bookings/components/AvailableTimes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ const SlotItem = ({
const [showConfirm, setShowConfirm] = useState(false);

const onButtonClick = useCallback(() => {
if (!showConfirm && (isOverlapping || skipConfirmStep)) {
if (!showConfirm && ((overlayCalendarToggled && isOverlapping) || skipConfirmStep)) {
setShowConfirm(true);
return;
}
setShowConfirm(false);
onTimeSelect(slot.time, slot?.attendees || 0, seatsPerTimeSlot, slot.bookingUid);
}, [
overlayCalendarToggled,
Expand All @@ -125,7 +124,14 @@ const SlotItem = ({
<div className="flex gap-2">
<Button
key={slot.time}
disabled={bookingFull || !!(slot.bookingUid && slot.bookingUid === bookingData?.uid)}
disabled={
bookingFull ||
!!(slot.bookingUid && slot.bookingUid === bookingData?.uid) ||
loadingStates.creatingBooking ||
loadingStates.creatingRecurringBooking ||
isVerificationCodeSending ||
loadingStates.creatingInstantBooking
}
data-testid="time"
data-disabled={bookingFull}
data-time={slot.time}
Expand Down

0 comments on commit 48fd326

Please sign in to comment.