diff --git a/packages/features/bookings/Booker/Booker.tsx b/packages/features/bookings/Booker/Booker.tsx index f5dd46f6588281..ca752dfa9dd043 100644 --- a/packages/features/bookings/Booker/Booker.tsx +++ b/packages/features/bookings/Booker/Booker.tsx @@ -1,6 +1,5 @@ import { AnimatePresence, LazyMotion, m } from "framer-motion"; import dynamic from "next/dynamic"; -import { useSearchParams } from "next/navigation"; import { useEffect, useMemo, useRef } from "react"; import { Toaster } from "react-hot-toast"; import StickyBox from "react-sticky-box"; @@ -67,14 +66,10 @@ const BookerComponent = ({ isPlatform, orgBannerUrl, customClassNames, + areInstantMeetingParametersSet = false, + userLocale, }: BookerProps & WrappedBookerProps) => { const { t } = useLocale(); - const searchParams = useSearchParams(); - - const areInstantMeetingParametersSet = !!event.data?.instantMeetingParameters - ? searchParams && - event.data.instantMeetingParameters.every((param) => Array.from(searchParams.values()).includes(param)) - : true; const [bookerState, setBookerState] = useBookerStore((state) => [state.state, state.setState], shallow); const selectedDate = useBookerStore((state) => state.selectedDate); @@ -358,6 +353,7 @@ const BookerComponent = ({ event={event.data} isPending={event.isPending} isPlatform={isPlatform} + locale={userLocale} /> {layout !== BookerLayouts.MONTH_VIEW && !(layout === "mobile" && bookerState === "booking") && ( diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx index ec5558b89d4f08..a5c09f7caa3384 100644 --- a/packages/features/bookings/Booker/components/EventMeta.tsx +++ b/packages/features/bookings/Booker/components/EventMeta.tsx @@ -1,5 +1,4 @@ import { m } from "framer-motion"; -import { useSession } from "next-auth/react"; import dynamic from "next/dynamic"; import { useEffect, useMemo } from "react"; import { shallow } from "zustand/shallow"; @@ -12,9 +11,9 @@ import { EventMetaBlock } from "@calcom/features/bookings/components/event-meta/ import { useTimePreferences } from "@calcom/features/bookings/lib"; import type { BookerEvent } from "@calcom/features/bookings/types"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { locales as i18nLocales } from "@calcom/lib/i18n"; import { EventTypeAutoTranslatedField } from "@calcom/prisma/enums"; +import i18nConfigration from "../../../../../i18n.json"; import { fadeInUp } from "../config"; import { useBookerStore } from "../store"; import { FromToTime } from "../utils/dates"; @@ -31,6 +30,7 @@ export const EventMeta = ({ isPending, isPlatform = true, classNames, + locale, }: { event?: Pick< BookerEvent, @@ -61,8 +61,8 @@ export const EventMeta = ({ eventMetaTitle?: string; eventMetaTimezoneSelect?: string; }; + locale?: string | null; }) => { - const session = useSession(); const { setTimezone, timeFormat, timezone } = useTimePreferences(); const selectedDuration = useBookerStore((state) => state.selectedDuration); const selectedTimeslot = useBookerStore((state) => state.selectedTimeslot); @@ -81,6 +81,7 @@ export const EventMeta = ({ () => (isPlatform ? [PlatformTimezoneSelect] : [WebTimezoneSelect]), [isPlatform] ); + const i18nLocales = i18nConfigration.locale.targets.concat([i18nConfigration.locale.source]); useEffect(() => { //In case the event has lockTimeZone enabled ,set the timezone to event's attached availability timezone @@ -107,7 +108,7 @@ export const EventMeta = ({ : isHalfFull ? "text-yellow-500" : "text-bookinghighlight"; - const userLocale = session.data?.user.locale ?? navigator.language; + const userLocale = locale ?? navigator.language; const translatedDescription = (event?.fieldTranslations ?? []).find( (trans) => trans.field === EventTypeAutoTranslatedField.DESCRIPTION && diff --git a/packages/features/bookings/Booker/types.ts b/packages/features/bookings/Booker/types.ts index 36ab95304bd4cf..a467355cb13165 100644 --- a/packages/features/bookings/Booker/types.ts +++ b/packages/features/bookings/Booker/types.ts @@ -90,6 +90,8 @@ export interface BookerProps { teamMemberEmail?: string | null; crmOwnerRecordType?: string | null; crmAppSlug?: string | null; + areInstantMeetingParametersSet?: boolean; + userLocale?: string | null; } export type WrappedBookerPropsMain = { diff --git a/packages/features/eventtypes/components/tabs/setup/EventSetupTab.tsx b/packages/features/eventtypes/components/tabs/setup/EventSetupTab.tsx index c6b318112f22af..43b0394f349944 100644 --- a/packages/features/eventtypes/components/tabs/setup/EventSetupTab.tsx +++ b/packages/features/eventtypes/components/tabs/setup/EventSetupTab.tsx @@ -142,17 +142,19 @@ export const EventSetupTab = ( > )} -