Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
SomayChauhan committed Jan 21, 2025
1 parent 203b38c commit 9290e43
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
9 changes: 4 additions & 5 deletions packages/features/bookings/Booker/Booker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ const BookerComponent = ({
}
};

const skipEventBooker = useSkipConfirmStep(bookingForm, event?.data?.bookingFields);
const skipConfirmStep = useSkipConfirmStep(bookingForm, event?.data?.bookingFields);

useEffect(() => {
if (event.isPending) return setBookerState("loading");
if (!selectedDate) return setBookerState("selecting_date");
if (!selectedTimeslot || skipEventBooker) return setBookerState("selecting_time");
if (!selectedTimeslot || skipConfirmStep) return setBookerState("selecting_time");
return setBookerState("booking");
}, [event, selectedDate, selectedTimeslot, setBookerState, skipEventBooker]);
}, [event, selectedDate, selectedTimeslot, setBookerState, skipConfirmStep]);

const slot = getQueryParam("slot");
useEffect(() => {
Expand Down Expand Up @@ -254,7 +254,6 @@ const BookerComponent = ({
verifyCode?.verifyCodeWithSessionNotRequired,
verifyCode?.verifyCodeWithSessionRequired,
isPlatform,
onSubmit,
]);

/**
Expand Down Expand Up @@ -451,7 +450,7 @@ const BookerComponent = ({
renderConfirmNotVerifyEmailButtonCond={renderConfirmNotVerifyEmailButtonCond}
isVerificationCodeSending={isVerificationCodeSending}
onSubmit={onSubmit}
skipEventBooker={skipEventBooker}
skipConfirmStep={skipConfirmStep}
/>
</BookerSection>
</AnimatePresence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type AvailableTimeSlotsProps = {
isVerificationCodeSending: boolean;
renderConfirmNotVerifyEmailButtonCond: boolean;
onSubmit: (timeSlot?: string) => void;
skipEventBooker: boolean;
skipConfirmStep: boolean;
};

/**
Expand All @@ -48,13 +48,11 @@ type AvailableTimeSlotsProps = {
export const AvailableTimeSlots = ({
extraDays,
limitHeight,
seatsPerTimeSlot,
showAvailableSeatsCount,
schedule,
isLoading,
event,
customClassNames,
skipEventBooker,
skipConfirmStep,
onSubmit,
...props
}: AvailableTimeSlotsProps) => {
Expand All @@ -81,7 +79,7 @@ export const AvailableTimeSlots = ({
showAvailableSeatsCount,
});
}
if (skipEventBooker) {
if (skipConfirmStep) {
onSubmit(time);
}
return;
Expand Down Expand Up @@ -148,10 +146,8 @@ export const AvailableTimeSlots = ({
showTimeFormatToggle={!isColumnView}
onTimeSelect={onTimeSelect}
slots={slots.slots}
seatsPerTimeSlot={seatsPerTimeSlot}
showAvailableSeatsCount={showAvailableSeatsCount}
event={event}
skipEventBooker={skipEventBooker}
skipConfirmStep={skipConfirmStep}
{...props}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const useSkipConfirmStep = (
};

checkSkipStep();
}, [bookingFormValues, bookingFields]);
}, [bookingFormValues, bookingFields, rescheduleUid]);

return canSkip;
};
Expand Down
10 changes: 5 additions & 5 deletions packages/features/bookings/components/AvailableTimes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type SlotItemProps = {
loadingStates: IUseBookingLoadingStates;
isVerificationCodeSending: boolean;
renderConfirmNotVerifyEmailButtonCond: boolean;
skipEventBooker: boolean;
skipConfirmStep: boolean;
};

const SlotItem = ({
Expand All @@ -63,7 +63,7 @@ const SlotItem = ({
loadingStates,
renderConfirmNotVerifyEmailButtonCond,
isVerificationCodeSending,
skipEventBooker,
skipConfirmStep,
}: SlotItemProps) => {
const { t } = useLocale();

Expand Down Expand Up @@ -102,7 +102,7 @@ const SlotItem = ({
const [showConfirm, setShowConfirm] = useState(false);

const onButtonClick = useCallback(() => {
if (!showConfirm && (isOverlapping || skipEventBooker)) {
if (!showConfirm && (isOverlapping || skipConfirmStep)) {
setShowConfirm(true);
return;
}
Expand All @@ -117,7 +117,7 @@ const SlotItem = ({
slot?.attendees,
slot.bookingUid,
seatsPerTimeSlot,
skipEventBooker,
skipConfirmStep,
]);

return (
Expand Down Expand Up @@ -166,7 +166,7 @@ const SlotItem = ({
<HoverCard.Root>
<HoverCard.Trigger asChild>
<m.div initial={{ width: 0 }} animate={{ width: "auto" }} exit={{ width: 0 }}>
{skipEventBooker ? (
{skipConfirmStep ? (
<Button
type="button"
onClick={() =>
Expand Down

0 comments on commit 9290e43

Please sign in to comment.