diff --git a/apps/web/public/bookerlayout_column_view.svg b/apps/web/public/bookerlayout_column_view.svg
new file mode 100644
index 0000000000..7b3c11af04
--- /dev/null
+++ b/apps/web/public/bookerlayout_column_view.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/apps/web/public/bookerlayout_month_view.svg b/apps/web/public/bookerlayout_month_view.svg
new file mode 100644
index 0000000000..382718e939
--- /dev/null
+++ b/apps/web/public/bookerlayout_month_view.svg
@@ -0,0 +1,60 @@
+
diff --git a/apps/web/public/bookerlayout_week_view.svg b/apps/web/public/bookerlayout_week_view.svg
new file mode 100644
index 0000000000..bb80ab2e12
--- /dev/null
+++ b/apps/web/public/bookerlayout_week_view.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 047dfd8ad9..3a1ea09f1a 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -294,6 +294,18 @@
"success": "Success",
"failed": "Failed",
"password_has_been_reset_login": "Your password has been reset. You can now login with your newly created password.",
+ "bookerlayout_title": "Layout",
+ "bookerlayout_default_title": "Default view",
+ "bookerlayout_description": "You can select multiple and your bookers can switch views.",
+ "bookerlayout_user_settings_title": "Booking layout",
+ "bookerlayout_user_settings_description": "You can select multiple and bookers can switch views. This can be overridden on a per event basis.",
+ "bookerlayout_month_view": "Month",
+ "bookerlayout_week_view": "Weekly",
+ "bookerlayout_column_view": "Column",
+ "bookerlayout_error_min_one_enabled": "At least one layout has to be enabled.",
+ "bookerlayout_error_default_not_enabled": "The layout you selected as the default view is not part of the enabled layouts.",
+ "bookerlayout_error_unknown_layout": "The layout you selected is not a valid layout.",
+ "bookerlayout_override_global_settings": "You can manage this for all your event types in <2>settings / appearance2> or <6>override for this event only6>.",
"unexpected_error_try_again": "An unexpected error occurred. Try again.",
"sunday_time_error": "Invalid time on Sunday",
"monday_time_error": "Invalid time on Monday",
diff --git a/packages/features/bookings/Booker/Booker.tsx b/packages/features/bookings/Booker/Booker.tsx
index 703012ebbc..e3036c388c 100644
--- a/packages/features/bookings/Booker/Booker.tsx
+++ b/packages/features/bookings/Booker/Booker.tsx
@@ -7,6 +7,7 @@ import { shallow } from "zustand/shallow";
import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useMediaQuery from "@calcom/lib/hooks/useMediaQuery";
+import { BookerLayouts, bookerLayoutOptions } from "@calcom/prisma/zod-utils";
import { AvailableTimeSlots } from "./components/AvailableTimeSlots";
import { BookEventForm } from "./components/BookEventForm";
@@ -49,7 +50,11 @@ const BookerComponent = ({
(state) => [state.selectedTimeslot, state.setSelectedTimeslot],
shallow
);
- const extraDays = layout === "large_timeslots" ? (isTablet ? 2 : 4) : 0;
+ const extraDays = layout === BookerLayouts.COLUMN_VIEW ? (isTablet ? 2 : 4) : 0;
+ const bookerLayouts = event.data?.profile?.bookerLayouts || {
+ defaultLayout: BookerLayouts.MONTH_VIEW,
+ enabledLayouts: bookerLayoutOptions,
+ };
const animationScope = useBookerResizeAnimation(layout, bookerState);
@@ -66,13 +71,14 @@ const BookerComponent = ({
eventId: event?.data?.id,
rescheduleUid,
rescheduleBooking,
+ layout: bookerLayouts.defaultLayout,
});
useEffect(() => {
if (isMobile && layout !== "mobile") {
setLayout("mobile");
} else if (!isMobile && layout === "mobile") {
- setLayout("small_calendar");
+ setLayout(BookerLayouts.MONTH_VIEW);
}
}, [isMobile, setLayout, layout]);
@@ -102,24 +108,32 @@ const BookerComponent = ({
// Sets booker size css variables for the size of all the columns.
...getBookerSizeClassNames(layout, bookerState),
"bg-default dark:bg-muted grid max-w-full 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"
+ layout === BookerLayouts.MONTH_VIEW && "border-subtle rounded-md border"
)}>
-
+
+ className={classNames(
+ "relative z-10 flex",
+ layout !== BookerLayouts.MONTH_VIEW && "sm:min-h-screen"
+ )}>
- {layout !== "small_calendar" && !(layout === "mobile" && bookerState === "booking") && (
-
-
-
- )}
+ {layout !== BookerLayouts.MONTH_VIEW &&
+ !(layout === "mobile" && bookerState === "booking") && (
+
+
+
+ )}
@@ -128,14 +142,14 @@ const BookerComponent = ({
area="main"
className="border-subtle sticky top-0 ml-[-1px] h-full p-5 md:w-[var(--booker-main-width)] md:border-l"
{...fadeInLeft}
- visible={bookerState === "booking" && layout !== "large_timeslots"}>
+ visible={bookerState === "booking" && layout !== BookerLayouts.COLUMN_VIEW}>
setSelectedTimeslot(null)} />
@@ -146,7 +160,7 @@ const BookerComponent = ({
key="large-calendar"
area="main"
visible={
- layout === "large_calendar" &&
+ layout === BookerLayouts.WEEK_VIEW &&
(bookerState === "selecting_date" || bookerState === "selecting_time")
}
className="border-muted sticky top-0 ml-[-1px] h-full md:border-l"
@@ -156,22 +170,22 @@ const BookerComponent = ({
@@ -182,14 +196,14 @@ const BookerComponent = ({
key="logo"
className={classNames(
"mt-auto mb-6 pt-6 [&_img]:h-[15px]",
- layout === "small_calendar" ? "block" : "hidden"
+ layout === BookerLayouts.MONTH_VIEW ? "block" : "hidden"
)}>
{!hideBranding ? : null}