diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index 4bbb49d668..232e112540 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -16,6 +16,7 @@ import { EventType } from "@prisma/client"; import * as Collapsible from "@radix-ui/react-collapsible"; import { useContracts } from "contexts/contractsContext"; import { TFunction } from "next-i18next"; +import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useMemo, useState } from "react"; import { FormattedNumber, IntlProvider } from "react-intl"; @@ -30,7 +31,7 @@ import { useIsEmbed, } from "@calcom/embed-core/embed-iframe"; import classNames from "@calcom/lib/classNames"; -import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; +import { CAL_URL, WEBSITE_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { getRecurringFreq } from "@calcom/lib/recurringStrings"; import { localStorage } from "@calcom/lib/webstorage"; @@ -87,23 +88,15 @@ export const locationKeyToString = (location: LocationObject, t: TFunction) => { } }; -const GoBackToPreviousPage = ({ slug }: { slug: string }) => { +const GoBackToPreviousPage = ({ slug, t }: { slug: string; t: TFunction }) => { const router = useRouter(); - const [previousPage, setPreviousPage] = useState(); - useEffect(() => { - setPreviousPage(document.referrer); - }, []); - - return previousPage === `${WEBAPP_URL}/${slug}` ? ( + return (
- router.back()} - /> -

Go Back

+
- ) : ( - <> ); }; @@ -655,7 +648,7 @@ const AvailabilityPage = ({ profile, eventType }: Props) => { {timezoneDropdown} - + {/* Temporarily disabled - booking?.startTime && rescheduleUid && (