feat: add support endpoint (#8404)
* feat: open intercom * Remove redirect from middleware, use next.config.js instead --------- Co-authored-by: Alex van Andel <me@alexvanandel.com>pull/8420/head^2
parent
c23738b885
commit
77b41a4623
|
@ -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") {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue