Scheduling infrastructure for absolutely everyone.
feat: add support endpoint (#8404)
Nafees Nazik77b41a4623a6
diff --git a/apps/web/next.config.js b/apps/web/next.config.jsindex 0e5ef483913..e3108db4c36 100644--- a/apps/web/next.config.js+++ b/apps/web/next.config.js@@ -297,6 +297,11 @@ const nextConfig = {destination: "/api/link?action=:action&email=:email&bookingUid=:bookingUid&oldToken=:oldToken",permanent: true,},+ {+ source: "/support",+ destination: "/event-types?openIntercom=true",+ permanent: true,+ },];if (process.env.NEXT_PUBLIC_WEBAPP_URL === "https://app.cal.com") {diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsxindex 1f2f0a99916..e2ec5c7043c 100644--- a/apps/web/pages/event-types/index.tsx+++ b/apps/web/pages/event-types/index.tsx@@ -8,6 +8,7 @@ import type { FC } from "react";import { useEffect, useState, memo } from "react";import { z } from "zod";+import useIntercom from "@calcom/features/ee/support/lib/intercom/useIntercom";import { EventTypeDescriptionLazy as EventTypeDescription } from "@calcom/features/eventtypes/components";import CreateEventTypeDialog from "@calcom/features/eventtypes/components/CreateEventTypeDialog";import { DuplicateDialog } from "@calcom/features/eventtypes/components/DuplicateDialog";@@ -756,9 +757,16 @@ const WithQuery = withQuery(trpc.viewer.eventTypes.getByViewer);const EventTypesPage = () => {const { t } = useLocale();const router = useRouter();-+ const { open } = useIntercom();+ const { query } = router;const isMobile = useMediaQuery("(max-width: 768px)");+ useEffect(() => {+ if (query?.openIntercom && query?.openIntercom === "true") {+ open();+ }+ }, []);+return (<div><HeadSeo