made it easier to see if there are more times available to scroll (#722)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Peer Richelsen 2021-09-22 15:44:38 +01:00 committed by GitHub
parent 81a3d82ce7
commit 43563bc8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,63 +29,65 @@ const AvailableTimes = ({
}); });
return ( return (
<div className="sm:pl-4 mt-8 sm:mt-0 text-center sm:w-1/3 md:max-h-97 overflow-y-auto"> <div className="sm:pl-4 mt-8 sm:mt-0 text-center sm:w-1/3 -mb-5">
<div className="text-gray-600 font-light text-lg mb-4 text-left"> <div className="text-gray-600 font-light text-lg mb-4 text-left">
<span className="w-1/2 dark:text-white text-gray-600"> <span className="w-1/2 dark:text-white text-gray-600">
<strong>{date.format("dddd")}</strong> <strong>{date.format("dddd")}</strong>
<span className="text-gray-500">{date.format(", DD MMMM")}</span> <span className="text-gray-500">{date.format(", DD MMMM")}</span>
</span> </span>
</div> </div>
{!loading && <div className="md:max-h-[364px] overflow-y-auto">
slots?.length > 0 && {!loading &&
slots.map((slot) => { slots?.length > 0 &&
const bookingUrl = { slots.map((slot) => {
pathname: "book", const bookingUrl = {
query: { pathname: "book",
...router.query, query: {
date: slot.time.format(), ...router.query,
type: eventTypeId, date: slot.time.format(),
}, type: eventTypeId,
}; },
};
if (rescheduleUid) { if (rescheduleUid) {
bookingUrl.query.rescheduleUid = rescheduleUid; bookingUrl.query.rescheduleUid = rescheduleUid;
} }
if (schedulingType === SchedulingType.ROUND_ROBIN) { if (schedulingType === SchedulingType.ROUND_ROBIN) {
bookingUrl.query.user = slot.users; bookingUrl.query.user = slot.users;
} }
return ( return (
<div key={slot.time.format()}> <div key={slot.time.format()}>
<Link href={bookingUrl}> <Link href={bookingUrl}>
<a className="block font-medium mb-4 bg-white dark:bg-gray-600 text-primary-500 dark:text-neutral-200 border border-primary-500 dark:border-transparent rounded-sm hover:text-white hover:bg-primary-500 dark:hover:border-black py-4 dark:hover:bg-black"> <a className="block font-medium mb-2 bg-white dark:bg-gray-600 text-primary-500 dark:text-neutral-200 border border-primary-500 dark:border-transparent rounded-sm hover:text-white hover:bg-primary-500 dark:hover:border-black py-4 dark:hover:bg-black">
{slot.time.format(timeFormat)} {slot.time.format(timeFormat)}
</a> </a>
</Link> </Link>
</div> </div>
); );
})} })}
{!loading && !error && !slots.length && ( {!loading && !error && !slots.length && (
<div className="w-full h-full flex flex-col justify-center content-center items-center -mt-4"> <div className="w-full h-full flex flex-col justify-center content-center items-center -mt-4">
<h1 className="text-xl text-black dark:text-white">All booked today.</h1> <h1 className="text-xl text-black dark:text-white">All booked today.</h1>
</div> </div>
)} )}
{loading && <Loader />} {loading && <Loader />}
{error && ( {error && (
<div className="bg-yellow-50 border-l-4 border-yellow-400 p-4"> <div className="bg-yellow-50 border-l-4 border-yellow-400 p-4">
<div className="flex"> <div className="flex">
<div className="flex-shrink-0"> <div className="flex-shrink-0">
<ExclamationIcon className="h-5 w-5 text-yellow-400" aria-hidden="true" /> <ExclamationIcon className="h-5 w-5 text-yellow-400" aria-hidden="true" />
</div> </div>
<div className="ml-3"> <div className="ml-3">
<p className="text-sm text-yellow-700">Could not load the available time slots.</p> <p className="text-sm text-yellow-700">Could not load the available time slots.</p>
</div>
</div> </div>
</div> </div>
</div> )}
)} </div>
</div> </div>
); );
}; };