Skip to content

Commit 58b2a64

Browse files
emrysalzomarsPeerRich
authored
AvailabilityPage improvements (#3118)
* Share WIP * Embed tests fixes * AvailabilityPage improvements * Type fixes * Fixes Datepicker day witdth * Update troubleshoot.tsx * Adds local cached slots and browsingDate * Migrating DatePicker to use Dayjs for timeZone support * Fixed Sunday not being available * Added comment to clarify what is going on * Minor bugfix in DatePicker, double empty slot markup * Change selected date with URL through ?date.. * Initialize properly w/o query params, remove minDate for now * Remove Loader as now using Skeleton * Handle Etc/GMT edge case (not a timeZone) * Added dark mode bg- color to SkeletonText + made text slightly more subtle on DatePicker Co-authored-by: zomars <zomars@me.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
1 parent 2c2261f commit 58b2a64

File tree

8 files changed

+245
-245
lines changed

8 files changed

+245
-245
lines changed

apps/web/components/booking/AvailableTimes.tsx

+20-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { FC, useEffect, useState } from "react";
66

77
import { useLocale } from "@calcom/lib/hooks/useLocale";
88
import { nameOfDay } from "@calcom/lib/weekday";
9+
import { SkeletonContainer, SkeletonText } from "@calcom/ui";
910

1011
import classNames from "@lib/classNames";
1112
import { timeZone } from "@lib/clock";
@@ -24,10 +25,12 @@ type AvailableTimesProps = {
2425
schedulingType: SchedulingType | null;
2526
seatsPerTimeSlot?: number | null;
2627
slots?: Slot[];
28+
isLoading: boolean;
2729
};
2830

2931
const AvailableTimes: FC<AvailableTimesProps> = ({
3032
slots = [],
33+
isLoading,
3134
date,
3235
eventTypeId,
3336
eventTypeSlug,
@@ -58,7 +61,7 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
5861
</span>
5962
</div>
6063
<div className="grid flex-grow grid-cols-2 gap-x-2 overflow-y-auto sm:block md:h-[364px]">
61-
{slots?.length > 0 &&
64+
{slots.length > 0 &&
6265
slots.map((slot) => {
6366
type BookingURL = {
6467
pathname: string;
@@ -129,11 +132,26 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
129132
</div>
130133
);
131134
})}
132-
{!slots.length && (
135+
136+
{!isLoading && !slots.length && (
133137
<div className="-mt-4 flex h-full w-full flex-col content-center items-center justify-center">
134138
<h1 className="my-6 text-xl text-black dark:text-white">{t("all_booked_today")}</h1>
135139
</div>
136140
)}
141+
142+
{isLoading && !slots.length && (
143+
<>
144+
<SkeletonContainer className="mb-2">
145+
<SkeletonText width="full" height="20" />
146+
</SkeletonContainer>
147+
<SkeletonContainer className="mb-2">
148+
<SkeletonText width="full" height="20" />
149+
</SkeletonContainer>
150+
<SkeletonContainer className="mb-2">
151+
<SkeletonText width="full" height="20" />
152+
</SkeletonContainer>
153+
</>
154+
)}
137155
</div>
138156
</div>
139157
);

0 commit comments

Comments
 (0)