chore: Remove all instances of useIntercom (#18500)

This commit is contained in:
Alex van Andel authored and GitHub committed 2025-01-07 07:43:46 -05:00
1 parent 06d8b98b15
commit fd7f6c32ae
5 files changed
+8 -281

No files matched your search

@@ -9,7 +9,6 @@ import { memo, useEffect, useState } from "react";
import { z } from "zod";
import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";
import useIntercom from "@calcom/features/ee/support/lib/intercom/useIntercom";
import { EventTypeEmbedButton, EventTypeEmbedDialog } from "@calcom/features/embed/EventTypeEmbed";
import { EventTypeDescription } from "@calcom/features/eventtypes/components";
import CreateEventTypeDialog from "@calcom/features/eventtypes/components/CreateEventTypeDialog";
@@ -951,11 +950,9 @@ const EventTypesPage: React.FC & {
getLayout?: AppProps["Component"]["getLayout"];
} = () => {
const { t } = useLocale();
const searchParams = useCompatSearchParams();
const { open } = useIntercom();
const { data: user } = useMeQuery();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [showProfileBanner, setShowProfileBanner] = useState(false);
const [_showProfileBanner, setShowProfileBanner] = useState(false);
const orgBranding = useOrgBranding();
const routerQuery = useRouterQuery();
const filters = getTeamsFiltersFromQuery(routerQuery);
@@ -973,9 +970,6 @@ const EventTypesPage: React.FC & {
});
useEffect(() => {
if (searchParams?.get("openIntercom") === "true") {
open();
}
/**
* During signup, if the account already exists, we redirect the user to /event-types instead of onboarding.
* Adding this redirection logic here as well to ensure the user is redirected to the correct redirectUrl.
@@ -2,7 +2,6 @@
import { usePathname } from "next/navigation";
import { useIntercom } from "@calcom/features/ee/support/lib/intercom/useIntercom";
import { classNames } from "@calcom/lib";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -32,12 +31,13 @@ export const CtaRow = ({ title, description, className, children }: CtaRowProps)
const BillingView = () => {
const pathname = usePathname();
const { t } = useLocale();
const { open } = useIntercom();
const returnTo = pathname;
const billingHref = `/api/integrations/stripepayment/portal?returnTo=${WEBAPP_URL}${returnTo}`;
const onContactSupportClick = async () => {
await open();
if (window.Plain) {
window.Plain.open();
}
};
return (
@@ -2,7 +2,6 @@
import { usePathname } from "next/navigation";
import { useIntercom } from "@calcom/features/ee/support/lib/intercom/useIntercom";
import Shell from "@calcom/features/shell/Shell";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -17,12 +16,13 @@ import { CtaRow } from "~/settings/billing/billing-view";
export default function PlatformBillingUpgrade() {
const pathname = usePathname();
const { t } = useLocale();
const { open } = useIntercom();
const returnTo = pathname;
const billingHref = `/api/integrations/stripepayment/portal?returnTo=${WEBAPP_URL}${returnTo}`;
const onContactSupportClick = async () => {
await open();
if (window.Plain) {
window.Plain.open();
}
};
const { isUserLoading, isUserBillingDataLoading, isPlatformUser, userBillingData, isPaidUser, userOrgId } =
useGetUserAttributes();