Revert "chore: downgrade react query atoms (#14328)" (#14332)

This reverts commit 8fc9b9ae9d.
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2024-04-04 10:55:15 +00:00
1 parent 8fc9b9ae9d
commit d7ece4f583
11 files changed
+140 -51

No files matched your search

@@ -178,7 +178,10 @@ const DateOverride = ({
onChange={(ranges) => ranges.forEach((range) => append({ ranges: [range] }))}
userTimeFormat={userTimeFormat}
Trigger={
<Button color="secondary" StartIcon="plus" data-testid="add-override">
<Button
color="secondary"
StartIcon="plus"
data-testid="add-override">
{t("add_an_override")}
</Button>
}
@@ -321,7 +324,11 @@ export function AvailabilitySettings({
openSidebar ? "translate-x-0 opacity-100" : "translate-x-full opacity-0"
)}>
<div className="flex flex-row items-center pt-5">
<Button StartIcon="arrow-left" color="minimal" onClick={() => setOpenSidebar(false)} />
<Button
StartIcon="arrow-left"
color="minimal"
onClick={() => setOpenSidebar(false)}
/>
<p className="-ml-2">{t("availability_settings")}</p>
<DeleteDialogButton
buttonClassName="ml-16 inline"
@@ -39,7 +39,7 @@ export const PlatformAvailabilitySettingsWrapper = ({
const { timeFormat } = me?.data || { timeFormat: null };
const { toast } = useToast();
const { mutate: deleteSchedule, isLoading: isDeletionInProgress } = useDeleteSchedule({
const { mutate: deleteSchedule, isPending: isDeletionInProgress } = useDeleteSchedule({
onSuccess: (res) => {
onDeleteSuccess?.(res);
toast({
@@ -54,7 +54,7 @@ export const PlatformAvailabilitySettingsWrapper = ({
},
});
const { mutate: updateSchedule, isLoading: isSavingInProgress } = useUpdateSchedule({
const { mutate: updateSchedule, isPending: isSavingInProgress } = useUpdateSchedule({
onSuccess: (res) => {
onUpdateSuccess?.(res);
toast({
@@ -98,24 +98,28 @@ export const PlatformAvailabilitySettingsWrapper = ({
weekStart="Sunday"
timeFormat={timeFormat}
isLoading={isLoading}
schedule={{
name: userSchedule.name,
id: userSchedule.id,
isLastSchedule: userSchedule.isLastSchedule,
isDefault: userSchedule.isDefault,
workingHours: userSchedule.workingHours,
dateOverrides: userSchedule.dateOverrides,
timeZone: userSchedule.timeZone,
availability: userSchedule.availability,
schedule:
userSchedule.schedule.reduce(
(acc: Schedule[], avail: Schedule) => [
...acc,
{ ...avail, startTime: new Date(avail.startTime), endTime: new Date(avail.endTime) },
],
[] as Schedule[]
) || [],
}}
schedule={
userSchedule
? {
name: userSchedule.name,
id: userSchedule.id,
isLastSchedule: userSchedule.isLastSchedule,
isDefault: userSchedule.isDefault,
workingHours: userSchedule.workingHours,
dateOverrides: userSchedule.dateOverrides,
timeZone: userSchedule.timeZone,
availability: userSchedule.availability,
schedule:
userSchedule.schedule.reduce(
(acc: Schedule[], avail: Schedule) => [
...acc,
{ ...avail, startTime: new Date(avail.startTime), endTime: new Date(avail.endTime) },
],
[] as Schedule[]
) || [],
}
: undefined
}
isDeleting={isDeletionInProgress}
isSaving={isSavingInProgress}
backPath=""
@@ -152,7 +152,7 @@ export const BookerPlatformWrapper = (props: BookerPlatformWrapperAtomProps) =>
});
const {
mutate: createBooking,
isLoading: creatingBooking,
isPending: creatingBooking,
error: createBookingError,
isError: isCreateBookingError,
} = useCreateBooking({
@@ -164,7 +164,7 @@ export const BookerPlatformWrapper = (props: BookerPlatformWrapperAtomProps) =>
});
const {
mutate: createRecBooking,
isLoading: creatingRecBooking,
isPending: creatingRecBooking,
error: createRecBookingError,
isError: isCreateRecBookingError,
@@ -177,7 +177,7 @@ export const BookerPlatformWrapper = (props: BookerPlatformWrapperAtomProps) =>
});
const {
mutate: createInstantBooking,
isLoading: creatingInstantBooking,
isPending: creatingInstantBooking,
error: createInstantBookingError,
isError: isCreateInstantBookingError,
} = useCreateInstantBooking({
@@ -193,7 +193,7 @@ export const BookerPlatformWrapper = (props: BookerPlatformWrapperAtomProps) =>
(state) => [state.calendarSettingsOverlayModal, state.setCalendarSettingsOverlayModal],
shallow
);
const { data: connectedCalendars, isLoading: fetchingConnectedCalendars } = useConnectedCalendars({
const { data: connectedCalendars, isPending: fetchingConnectedCalendars } = useConnectedCalendars({
enabled: !!calendarSettingsOverlay,
});
const calendars = connectedCalendars as ConnectedDestinationCalendars;
+2 -2
View File
@@ -4,7 +4,7 @@
"type": "module",
"description": "Customizable UI components to integrate scheduling into your product.",
"authors": "Cal.com, Inc.",
"version": "1.0.9",
"version": "1.0.6",
"scripts": {
"dev": "yarn vite build --watch & npx tailwindcss -i ./globals.css -o ./globals.min.css --postcss --minify --watch",
"build": "yarn vite build && npx tailwindcss -i ./globals.css -o ./globals.min.css --postcss --minify",
@@ -44,7 +44,7 @@
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-query": "^5.17.15",
"class-variance-authority": "^0.4.0",
"clsx": "^2.0.0",
"lucide-react": "^0.364.0",