Skip to content

Commit

Permalink
feat(docs): remove intercom plugin (#5986)
Browse files Browse the repository at this point in the history
  • Loading branch information
alicanerdurmaz committed May 24, 2024
1 parent 9455d96 commit acd9719
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 58 deletions.
1 change: 0 additions & 1 deletion documentation/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ const siteConfig = {
},
],
]),
"./plugins/intercom.js",
"./plugins/clarity.js",
"./plugins/templates.js",
"./plugins/example-redirects.js",
Expand Down
29 changes: 0 additions & 29 deletions documentation/plugins/intercom.js

This file was deleted.

28 changes: 0 additions & 28 deletions documentation/src/refine-theme/common-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ import ErrorPageContent from "@theme/ErrorPageContent";
import LayoutProvider from "@theme/Layout/Provider";
import SkipToContent from "@theme/SkipToContent";
import { LivePreviewProvider } from "../components/live-preview-context";
import useIsMobile from "../hooks/use-is-mobile";
import clsx from "clsx";

declare global {
interface Window {
Intercom: any;
}
}

type Props = {
className?: string;
} & Record<string, any>;
Expand All @@ -27,27 +20,6 @@ export const CommonLayout = (props: Props) => {

const location = useLocation();

const isMobile = useIsMobile();

React.useEffect(() => {
if (typeof window !== "undefined" && !isMobile) {
if (
location.pathname.startsWith("/blog") ||
location.pathname.startsWith("/")
) {
window?.Intercom?.("update", { hide_default_launcher: true });
} else {
window?.Intercom?.("update", { hide_default_launcher: false });
}
}
}, [location, isMobile]);

useEffect(() => {
if (isMobile) {
window?.Intercom?.("update", { hide_default_launcher: true });
}
}, [isMobile]);

// it handles kapa ai widget visibility
// kapa ai widget script initalized in docusaurus.config.js
useEffect(() => {
Expand Down

0 comments on commit acd9719

Please sign in to comment.