feat: support hideEventTypeDetails query param on booking pages (#25565)
* fix: lint error * feat: support `hideEventTypeDetails` via query param Allow the event type details to be hidden based on the hideEventTypeDetails query parameter when not in embed mode * feat: add hideEventTypeDetails prop to EventMeta --------- Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com>
This commit is contained in:
co-authored by
Dhairyashil Shinde
parent
308c7fa12b
commit
311b6e071d
@@ -431,7 +431,8 @@ const BookerComponent = ({
|
||||
isPrivateLink={!!hashedLink}
|
||||
locale={userLocale}
|
||||
timeZones={timeZones}
|
||||
roundRobinHideOrgAndTeam={roundRobinHideOrgAndTeam}>
|
||||
roundRobinHideOrgAndTeam={roundRobinHideOrgAndTeam}
|
||||
hideEventTypeDetails={hideEventTypeDetails}>
|
||||
{eventMetaChildren}
|
||||
</EventMeta>
|
||||
)}
|
||||
|
||||
@@ -4,7 +4,6 @@ import { useEffect, useMemo } from "react";
|
||||
import { shallow } from "zustand/shallow";
|
||||
|
||||
import { Timezone as PlatformTimezoneSelect } from "@calcom/atoms/timezone";
|
||||
import { useEmbedUiConfig, useIsEmbed } from "@calcom/embed-core/embed-iframe";
|
||||
import { EventDetails, EventMembers, EventMetaSkeleton, EventTitle } from "@calcom/features/bookings";
|
||||
import { useBookerStoreContext } from "@calcom/features/bookings/Booker/BookerStoreProvider";
|
||||
import type { Timezone } from "@calcom/features/bookings/Booker/types";
|
||||
@@ -56,6 +55,7 @@ export const EventMeta = ({
|
||||
children,
|
||||
selectedTimeslot,
|
||||
roundRobinHideOrgAndTeam,
|
||||
hideEventTypeDetails = false,
|
||||
}: {
|
||||
event?: Pick<
|
||||
BookerEvent,
|
||||
@@ -94,6 +94,7 @@ export const EventMeta = ({
|
||||
children?: React.ReactNode;
|
||||
selectedTimeslot: string | null;
|
||||
roundRobinHideOrgAndTeam?: boolean;
|
||||
hideEventTypeDetails?: boolean;
|
||||
}) => {
|
||||
const { timeFormat, timezone } = useBookerTime();
|
||||
const [setTimezone] = useTimePreferences((state) => [state.setTimezone]);
|
||||
@@ -107,9 +108,6 @@ export const EventMeta = ({
|
||||
shallow
|
||||
);
|
||||
const { i18n, t } = useLocale();
|
||||
const embedUiConfig = useEmbedUiConfig();
|
||||
const isEmbed = useIsEmbed();
|
||||
const hideEventTypeDetails = isEmbed ? embedUiConfig.hideEventTypeDetails : false;
|
||||
const [TimezoneSelect] = useMemo(
|
||||
() => (isPlatform ? [PlatformTimezoneSelect] : [WebTimezoneSelect]),
|
||||
[isPlatform]
|
||||
|
||||
@@ -56,7 +56,7 @@ export const useBookerLayout = (
|
||||
layout !== _layout
|
||||
) {
|
||||
const validLayout = bookerLayouts.enabledLayouts.find((userLayout) => userLayout === layout);
|
||||
validLayout && setLayout(validLayout);
|
||||
if (validLayout) setLayout(validLayout);
|
||||
}
|
||||
}, [bookerLayouts, setLayout, _layout, isEmbed, isMobile]);
|
||||
|
||||
@@ -76,7 +76,12 @@ export const useBookerLayout = (
|
||||
|
||||
const shouldShowFormInDialog = shouldShowFormInDialogMap[layout];
|
||||
|
||||
const hideEventTypeDetails = isEmbed ? embedUiConfig.hideEventTypeDetails : false;
|
||||
const hideEventTypeDetailsParam = getQueryParam("hideEventTypeDetails");
|
||||
const hideEventTypeDetails = isEmbed
|
||||
? embedUiConfig.hideEventTypeDetails
|
||||
: typeof hideEventTypeDetailsParam === "string"
|
||||
? hideEventTypeDetailsParam === "true"
|
||||
: false;
|
||||
|
||||
return {
|
||||
shouldShowFormInDialog,
|
||||
|
||||
Reference in New Issue
Block a user