diff --git a/documentation/docusaurus.config.js b/documentation/docusaurus.config.js index 7492f444ddb6..93a77c2f0ee1 100644 --- a/documentation/docusaurus.config.js +++ b/documentation/docusaurus.config.js @@ -159,7 +159,6 @@ const siteConfig = { }, ], ]), - "./plugins/intercom.js", "./plugins/clarity.js", "./plugins/templates.js", "./plugins/example-redirects.js", diff --git a/documentation/plugins/intercom.js b/documentation/plugins/intercom.js deleted file mode 100644 index 9d12132879dc..000000000000 --- a/documentation/plugins/intercom.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require("path"); - -module.exports = function (context) { - const { siteConfig } = context; - const { themeConfig } = siteConfig; - - return { - name: "@pankod/docusaurus-plugin-intercom", - - injectHtmlTags() { - return { - postBodyTags: [ - { - tagName: "script", - innerHTML: ` - window.intercomSettings = { - api_base: "https://api-iam.intercom.io", - app_id: "m6xbwbzo" - }; - - // We pre-filled your app ID in the widget URL: 'https://widget.intercom.io/widget/m6xbwbzo' - (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/m6xbwbzo';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); - `, - }, - ], - }; - }, - }; -}; diff --git a/documentation/src/refine-theme/common-layout.tsx b/documentation/src/refine-theme/common-layout.tsx index a4523c3de5d8..51b1f7508f6b 100644 --- a/documentation/src/refine-theme/common-layout.tsx +++ b/documentation/src/refine-theme/common-layout.tsx @@ -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; @@ -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(() => {