Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile calendar #16934

Closed
wants to merge 13 commits into from
4 changes: 2 additions & 2 deletions apps/web/modules/bookings/views/bookings-single-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery";
import useTheme from "@calcom/lib/hooks/useTheme";
import isSmsCalEmail from "@calcom/lib/isSmsCalEmail";
import { getEveryFreqFor } from "@calcom/lib/recurringStrings";
import { getIs24hClockFromLocalStorage, isBrowserLocale24h } from "@calcom/lib/timeFormat";
import { isBrowserLocale24h } from "@calcom/lib/timeFormat";
import { localStorage } from "@calcom/lib/webstorage";
import { BookingStatus, SchedulingType } from "@calcom/prisma/enums";
import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";
Expand Down Expand Up @@ -256,7 +256,7 @@ export default function Success(props: PageProps) {
setDate(
date.tz(localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess() || "Europe/London")
);
setIs24h(props?.userTimeFormat ? props.userTimeFormat === 24 : !!getIs24hClockFromLocalStorage());
setIs24h(true);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [eventType, needsConfirmation]);

Expand Down
57 changes: 2 additions & 55 deletions packages/features/bookings/Booker/Booker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { VerifyCodeDialog } from "../components/VerifyCodeDialog";
import { AvailableTimeSlots } from "./components/AvailableTimeSlots";
import { BookEventForm } from "./components/BookEventForm";
import { BookFormAsModal } from "./components/BookEventForm/BookFormAsModal";
import { EventMeta } from "./components/EventMeta";
import { HavingTroubleFindingTime } from "./components/HavingTroubleFindingTime";
import { Header } from "./components/Header";
import { InstantBooking } from "./components/InstantBooking";
Expand Down Expand Up @@ -281,6 +280,7 @@ const BookerComponent = ({
!isEmbed && "sm:transition-[width] sm:duration-300",
isEmbed && layout === BookerLayouts.MONTH_VIEW && "border-booker sm:border-booker-width",
!isEmbed && layout === BookerLayouts.MONTH_VIEW && `border-subtle border`,

`${customClassNames?.bookerContainer}`
)}>
<AnimatePresence>
Expand Down Expand Up @@ -327,37 +327,6 @@ const BookerComponent = ({
)}
</BookerSection>
)}
<StickyOnDesktop key="meta" className={classNames("relative z-10 flex [grid-area:meta]")}>
<BookerSection
area="meta"
className="max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]">
{!hideEventTypeDetails && orgBannerUrl && !isPlatform && (
<img
loading="eager"
className="-mb-9 ltr:rounded-tl-md rtl:rounded-tr-md"
alt="org banner"
src={orgBannerUrl}
/>
)}
<EventMeta
classNames={{
eventMetaContainer: customClassNames?.eventMetaCustomClassNames?.eventMetaContainer,
eventMetaTitle: customClassNames?.eventMetaCustomClassNames?.eventMetaTitle,
eventMetaTimezoneSelect:
customClassNames?.eventMetaCustomClassNames?.eventMetaTimezoneSelect,
}}
event={event.data}
isPending={event.isPending}
isPlatform={isPlatform}
/>
{layout !== BookerLayouts.MONTH_VIEW &&
!(layout === "mobile" && bookerState === "booking") && (
<div className="mt-auto px-5 py-3">
<DatePicker event={event} schedule={schedule} scrollToTimeSlots={scrollToTimeSlots} />
</div>
)}
</BookerSection>
</StickyOnDesktop>

<BookerSection
key="book-event-form"
Expand All @@ -368,33 +337,11 @@ const BookerComponent = ({
{EventBooker}
</BookerSection>

<BookerSection
key="datepicker"
area="main"
visible={bookerState !== "booking" && layout === BookerLayouts.MONTH_VIEW}
{...fadeInLeft}
initial="visible"
className="md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]">
<DatePicker
classNames={{
datePickerContainer: customClassNames?.datePickerCustomClassNames?.datePickerContainer,
datePickerTitle: customClassNames?.datePickerCustomClassNames?.datePickerTitle,
datePickerDays: customClassNames?.datePickerCustomClassNames?.datePickerDays,
datePickerDate: customClassNames?.datePickerCustomClassNames?.datePickerDate,
datePickerDatesActive: customClassNames?.datePickerCustomClassNames?.datePickerDatesActive,
datePickerToggle: customClassNames?.datePickerCustomClassNames?.datePickerToggle,
}}
event={event}
schedule={schedule}
scrollToTimeSlots={scrollToTimeSlots}
/>
</BookerSection>

<BookerSection
key="large-calendar"
area="main"
visible={layout === BookerLayouts.WEEK_VIEW}
className="border-subtle sticky top-0 ml-[-1px] h-full md:border-l"
className="border-subtle sticky top-0 ml-[-1px] h-full md:border-l"
{...fadeInLeft}>
<LargeCalendar
extraDays={extraDays}
Expand Down
3 changes: 1 addition & 2 deletions packages/features/bookings/Booker/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { BookerLayouts } from "@calcom/prisma/zod-utils";
import { Button, ButtonGroup, Icon, ToggleGroup, Tooltip } from "@calcom/ui";

import { TimeFormatToggle } from "../../components/TimeFormatToggle";
import { useBookerStore } from "../store";
import type { BookerLayout } from "../types";

Expand Down Expand Up @@ -134,7 +133,7 @@ export function Header({
</div>
<div className="ml-auto flex gap-2">
{renderOverlay?.()}
<TimeFormatToggle />
{/*<TimeFormatToggle />*/}
<div className="fixed top-4 ltr:right-4 rtl:left-4">
<LayoutToggleWithData
layout={layout}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const LargeCalendar = ({
}, [overlayEvents, displayOverlay]);

return (
<div className="h-full [--calendar-dates-sticky-offset:66px]">
<div className="h-full ">
<Calendar
isPending={isLoading}
availableTimeslots={availableSlots}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { useIsPlatform } from "@calcom/atoms/monorepo";

import type { UseCalendarsReturnType } from "../hooks/useCalendars";
import { useOverlayCalendar } from "../hooks/useOverlayCalendar";
import { OverlayCalendarContinueModal } from "./OverlayCalendarContinueModal";
import { OverlayCalendarSettingsModal } from "./OverlayCalendarSettingsModal";
import { OverlayCalendarSwitch } from "./OverlayCalendarSwitch";

type OverlayCalendarProps = Pick<
UseCalendarsReturnType,
Expand Down Expand Up @@ -48,18 +46,18 @@ export const OverlayCalendar = ({

return (
<>
<OverlayCalendarSwitch
enabled={isOverlayCalendarEnabled}
hasSession={hasSession}
onStateChange={handleSwitchStateChange}
/>
{!isPlatform && (
<OverlayCalendarContinueModal
open={isOpenOverlayContinueModal}
onClose={handleCloseContinueModal}
onContinue={handleClickContinue}
/>
)}
{/*<OverlayCalendarSwitch*/}
{/* enabled={isOverlayCalendarEnabled}*/}
{/* hasSession={hasSession}*/}
{/* onStateChange={handleSwitchStateChange}*/}
{/*/>*/}
{/*{!isPlatform && (*/}
{/* <OverlayCalendarContinueModal*/}
{/* open={isOpenOverlayContinueModal}*/}
{/* onClose={handleCloseContinueModal}*/}
{/* onContinue={handleClickContinue}*/}
{/* />*/}
{/*)}*/}
<OverlayCalendarSettingsModal
connectedCalendars={connectedCalendars}
open={isOpenOverlaySettingsModal}
Expand Down
4 changes: 1 addition & 3 deletions packages/features/bookings/Booker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ export const getBookerSizeClassNames = (
`[--booker-main-width:480px] ${getBookerMetaClass("lg:[--booker-meta-width:280px]")}`,
// Fullscreen view settings.
layout !== BookerLayouts.MONTH_VIEW &&
`[--booker-main-width:480px] [--booker-meta-width:340px] ${getBookerMetaClass(
"lg:[--booker-meta-width:424px]"
)}`,
`[--booker-main-width:480px] ${getBookerMetaClass("lg:[--booker-meta-width:424px]")}`,
];
};

Expand Down
Loading
Loading