feat(UI): improvements booker (#9221)
* Changed background from muted to default * Improved skelleton color for loading states. Also prevented scrollbar in available timeslots loading state by showing less skeletons. * Moved description to top, above other event meta, since this block doesnt have an icon and looks better this way.
This commit is contained in:
1 parent
0d4e625041
commit
220023f403
9 files changed
+16
-23
No files matched your search
@@ -103,7 +103,7 @@ const BookerComponent = ({
|
||||
since that's not a valid option, so it would set the layout to null.
|
||||
*/}
|
||||
{!isMobile && (
|
||||
<div className="[&>div]:bg-muted fixed top-2 right-3 z-10">
|
||||
<div className="[&>div]:bg-default fixed top-2 right-3 z-10">
|
||||
<ToggleGroup
|
||||
onValueChange={onLayoutToggle}
|
||||
defaultValue={layout}
|
||||
@@ -133,7 +133,7 @@ const BookerComponent = ({
|
||||
className={classNames(
|
||||
// Sets booker size css variables for the size of all the columns.
|
||||
...getBookerSizeClassNames(layout, bookerState),
|
||||
"bg-muted grid max-w-full auto-rows-fr items-start overflow-clip dark:[color-scheme:dark] sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row",
|
||||
"bg-default grid max-w-full auto-rows-fr items-start overflow-clip dark:[color-scheme:dark] sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row",
|
||||
layout === "small_calendar" && "border-subtle rounded-md border"
|
||||
)}>
|
||||
<AnimatePresence>
|
||||
|
||||
@@ -35,7 +35,12 @@ export const EventMeta = () => {
|
||||
{!isLoading && !!event && (
|
||||
<m.div {...fadeInUp} layout transition={{ ...fadeInUp.transition, delay: 0.3 }}>
|
||||
<EventMembers schedulingType={event.schedulingType} users={event.users} profile={event.profile} />
|
||||
<EventTitle className="mt-2 mb-8">{event?.title}</EventTitle>
|
||||
<EventTitle className="my-2">{event?.title}</EventTitle>
|
||||
{event.description && (
|
||||
<EventMetaBlock contentClassName="mb-8 break-words max-w-full max-h-[180px] scroll-bar pr-4">
|
||||
<div dangerouslySetInnerHTML={{ __html: event.description }} />
|
||||
</EventMetaBlock>
|
||||
)}
|
||||
<div className="space-y-4 font-medium">
|
||||
{rescheduleBooking && (
|
||||
<EventMetaBlock icon={Calendar}>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const LargeCalendar = () => {
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="bg-muted flex h-full w-full flex-col items-center justify-center">
|
||||
<div className="bg-default flex h-full w-full flex-col items-center justify-center">
|
||||
Something big is coming...
|
||||
<br />
|
||||
<button
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
const UnAvailableMessage = ({ children, title }: { children: React.ReactNode; title: string }) => (
|
||||
<div className="mx-auto w-full max-w-2xl">
|
||||
<div className="bg-muted border-subtle overflow-hidden rounded-lg border p-10">
|
||||
<div className="border-subtle bg-default overflow-hidden rounded-lg border p-10">
|
||||
<h2 className="font-cal mb-4 text-3xl">{title}</h2>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -110,9 +110,9 @@ export const AvailableTimes = ({
|
||||
};
|
||||
|
||||
export const AvailableTimesSkeleton = () => (
|
||||
<div className="mt-8 flex h-full w-[20%] flex-col only:w-full">
|
||||
{/* Random number of elements between 1 and 10. */}
|
||||
{Array.from({ length: Math.floor(Math.random() * 10) + 1 }).map((_, i) => (
|
||||
<div className="mt-8 flex w-[20%] flex-col only:w-full">
|
||||
{/* Random number of elements between 1 and 6. */}
|
||||
{Array.from({ length: Math.floor(Math.random() * 6) + 1 }).map((_, i) => (
|
||||
<SkeletonText className="mb-4 h-6 w-full" key={i} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,6 @@ interface EventMetaProps {
|
||||
* Default order in which the event details will be rendered.
|
||||
*/
|
||||
const defaultEventDetailsBlocks = [
|
||||
EventDetailBlocks.DESCRIPTION,
|
||||
EventDetailBlocks.REQUIRES_CONFIRMATION,
|
||||
EventDetailBlocks.DURATION,
|
||||
EventDetailBlocks.OCCURENCES,
|
||||
@@ -112,16 +111,6 @@ export const EventDetails = ({ event, blocks = defaultEventDetailsBlocks }: Even
|
||||
}
|
||||
|
||||
switch (block) {
|
||||
case EventDetailBlocks.DESCRIPTION:
|
||||
if (!event.description) return null;
|
||||
return (
|
||||
<EventMetaBlock
|
||||
key={block}
|
||||
contentClassName="break-words max-w-full max-h-[180px] scroll-bar pr-4">
|
||||
<div dangerouslySetInnerHTML={{ __html: event.description }} />
|
||||
</EventMetaBlock>
|
||||
);
|
||||
|
||||
case EventDetailBlocks.DURATION:
|
||||
return (
|
||||
<EventMetaBlock key={block} icon={Clock}>
|
||||
|
||||
@@ -8,7 +8,6 @@ export type PublicEvent = NonNullable<RouterOutputs["viewer"]["public"]["event"]
|
||||
export type ValidationErrors<T extends object> = { key: FieldPath<T>; error: ErrorOption }[];
|
||||
|
||||
export enum EventDetailBlocks {
|
||||
DESCRIPTION,
|
||||
// Includes duration select when event has multiple durations.
|
||||
DURATION,
|
||||
LOCATION,
|
||||
|
||||
@@ -146,7 +146,7 @@ const Days = ({
|
||||
<div key={`e-${idx}`} />
|
||||
) : props.isLoading ? (
|
||||
<button
|
||||
className=" bg-muted text-muted opcaity-50 absolute top-0 left-0 right-0 bottom-0 mx-auto flex w-full items-center justify-center rounded-sm border-transparent text-center font-medium"
|
||||
className="bg-muted text-muted absolute top-0 left-0 right-0 bottom-0 mx-auto flex w-full items-center justify-center rounded-sm border-transparent text-center font-medium opacity-50"
|
||||
key={`e-${idx}`}
|
||||
disabled>
|
||||
<SkeletonText className="h-4 w-5" />
|
||||
|
||||
@@ -52,7 +52,7 @@ const Skeleton = <T extends keyof JSX.IntrinsicElements | React.FC>({
|
||||
<Component
|
||||
className={classNames(
|
||||
loading
|
||||
? classNames("font-size-0 bg-subtle animate-pulse rounded-md text-transparent", loadingClassName)
|
||||
? classNames("font-size-0 bg-emphasis animate-pulse rounded-md text-transparent", loadingClassName)
|
||||
: "",
|
||||
className
|
||||
)}
|
||||
@@ -69,7 +69,7 @@ const SkeletonText: React.FC<SkeletonBaseProps & { invisible?: boolean }> = ({
|
||||
return (
|
||||
<span
|
||||
className={classNames(
|
||||
`font-size-0 bg-subtle inline-block animate-pulse rounded-md empty:before:inline-block empty:before:content-['']`,
|
||||
`font-size-0 bg-emphasis inline-block animate-pulse rounded-md empty:before:inline-block empty:before:content-['']`,
|
||||
className,
|
||||
invisible ? "invisible" : ""
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user