From d8d258b5223af86c5f2d4c9662279d1199bb3b3e Mon Sep 17 00:00:00 2001 From: ae_atrofimov Date: Wed, 17 Jul 2024 14:13:12 +0200 Subject: [PATCH] feat(docs): act-1453 - added intercom widget --- package.json | 3 ++- src/theme/Footer/index.js | 10 ++++++++++ yarn.lock | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 09f4151b890..c76a180b795 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@docusaurus/plugin-content-docs": "^3.0.0", "@docusaurus/theme-common": "^3.0.0", "@docusaurus/theme-mermaid": "^3.0.0", + "@intercom/messenger-js-sdk": "^0.0.11", "@mdx-js/react": "^3.0.0", "@metamask/design-tokens": "^1.11.1", "@metamask/docusaurus-openrpc": "^0.4.1", @@ -108,4 +109,4 @@ "@metamask/sdk-react>@metamask/sdk>eciesjs>secp256k1": false } } -} \ No newline at end of file +} diff --git a/src/theme/Footer/index.js b/src/theme/Footer/index.js index ef819cdf155..2300692808e 100644 --- a/src/theme/Footer/index.js +++ b/src/theme/Footer/index.js @@ -1,5 +1,7 @@ import React, { useEffect } from "react"; import Footer from "@theme-original/Footer"; +import { Intercom } from "@intercom/messenger-js-sdk"; +import useIsBrowser from "@docusaurus/useIsBrowser"; export default function FooterWrapper(props) { useEffect(() => { @@ -14,6 +16,14 @@ export default function FooterWrapper(props) { cookieBtn.removeEventListener("click", handleManageCookie); }; }, []); + + const isBrowser = useIsBrowser(); + if (isBrowser) { + Intercom({ + app_id: 'txttgas6' + }); + } + return ( <>