chore: downgrade react query atoms (#14328)
* refactor: downgrade atoms react-query to v4 * driveby: prettier format file * refactor: react-query isPending to isLoading * chore: bump atoms version * refactor: isPending -> isLoading * chore: bump version
This commit is contained in:
1 parent
d1175bf7de
commit
8fc9b9ae9d
11 files changed
+51
-140
No files matched your search
@@ -134,7 +134,7 @@ const BookerComponent = ({
|
||||
} = calendars;
|
||||
|
||||
useEffect(() => {
|
||||
if (event.isPending) return setBookerState("loading");
|
||||
if (event.isLoading) return setBookerState("loading");
|
||||
if (!selectedDate) return setBookerState("selecting_date");
|
||||
if (!selectedTimeslot) return setBookerState("selecting_time");
|
||||
return setBookerState("booking");
|
||||
@@ -354,7 +354,7 @@ const BookerComponent = ({
|
||||
/>
|
||||
)}
|
||||
|
||||
<EventMeta event={event.data} isPending={event.isPending} isPlatform={isPlatform} />
|
||||
<EventMeta event={event.data} isPending={event.isLoading} isPlatform={isPlatform} />
|
||||
{layout !== BookerLayouts.MONTH_VIEW &&
|
||||
!(layout === "mobile" && bookerState === "booking") && (
|
||||
<div className="mt-auto px-5 py-3 ">
|
||||
@@ -392,7 +392,7 @@ const BookerComponent = ({
|
||||
<LargeCalendar
|
||||
extraDays={extraDays}
|
||||
schedule={schedule.data}
|
||||
isLoading={schedule.isPending}
|
||||
isLoading={schedule.isLoading}
|
||||
event={event}
|
||||
/>
|
||||
</BookerSection>
|
||||
@@ -416,7 +416,7 @@ const BookerComponent = ({
|
||||
extraDays={extraDays}
|
||||
limitHeight={layout === BookerLayouts.MONTH_VIEW}
|
||||
schedule={schedule?.data}
|
||||
isLoading={schedule.isPending}
|
||||
isLoading={schedule.isLoading}
|
||||
seatsPerTimeSlot={event.data?.seatsPerTimeSlot}
|
||||
showAvailableSeatsCount={event.data?.seatsShowAvailabilityCount}
|
||||
event={event}
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { FieldError } from "react-hook-form";
|
||||
import { IS_CALCOM, WEBSITE_URL } from "@calcom/lib/constants";
|
||||
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert, Button, EmptyScreen, Form, Icon } from "@calcom/ui";
|
||||
import { Alert, Button, EmptyScreen, Form } from "@calcom/ui";
|
||||
|
||||
import { useBookerStore } from "../../store";
|
||||
import type { useEventReturnType } from "../../utils/event";
|
||||
@@ -63,7 +63,7 @@ export const BookEventForm = ({
|
||||
}, [eventType]);
|
||||
|
||||
if (eventQuery.isError) return <Alert severity="warning" message={t("error_booking_event")} />;
|
||||
if (eventQuery.isPending || !eventQuery.data) return <FormSkeleton />;
|
||||
if (eventQuery.isLoading || !eventQuery.data) return <FormSkeleton />;
|
||||
if (!timeslot)
|
||||
return (
|
||||
<EmptyScreen
|
||||
|
||||
@@ -27,7 +27,7 @@ export const DatePicker = ({
|
||||
|
||||
return (
|
||||
<DatePickerComponent
|
||||
isPending={schedule.isPending}
|
||||
isPending={schedule.isLoading}
|
||||
onChange={(date: Dayjs | null) => {
|
||||
setSelectedDate(date === null ? date : date.format("YYYY-MM-DD"));
|
||||
}}
|
||||
|
||||
@@ -29,7 +29,7 @@ export const EventMeta = ({
|
||||
isPlatform = true,
|
||||
}: {
|
||||
event: useEventReturnType["data"];
|
||||
isPending: useEventReturnType["isPending"];
|
||||
isPending: useEventReturnType["isLoading"];
|
||||
isPlatform?: boolean;
|
||||
}) => {
|
||||
const { setTimezone, timeFormat, timezone } = useTimePreferences();
|
||||
|
||||
@@ -33,7 +33,7 @@ export const useEvent = () => {
|
||||
data: event?.data,
|
||||
isSuccess: event?.isSuccess,
|
||||
isError: event?.isError,
|
||||
isPending: event?.isPending,
|
||||
isLoading: event?.isPending,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -104,7 +104,6 @@ export const useScheduleForEvent = ({
|
||||
|
||||
return {
|
||||
data: schedule?.data,
|
||||
isPending: schedule?.isPending,
|
||||
isError: schedule?.isError,
|
||||
isSuccess: schedule?.isSuccess,
|
||||
isLoading: schedule?.isLoading,
|
||||
|
||||
@@ -240,7 +240,7 @@ const EmailEmbed = ({
|
||||
<CollapsibleContent>
|
||||
<div className="text-default text-sm">{t("select_date")}</div>
|
||||
<DatePicker
|
||||
isPending={schedule.isPending}
|
||||
isPending={schedule.isLoading}
|
||||
onChange={(date: Dayjs | null) => {
|
||||
setSelectedDate(date === null ? date : date.format("YYYY-MM-DD"));
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user