Skip to content

Commit

Permalink
feat(docs): act-1453 - added intercom widget (MetaMask#1417)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrofimovAnton85 authored Jul 17, 2024
1 parent 5638ccd commit 16ed267
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -108,4 +109,4 @@
"@metamask/sdk-react>@metamask/sdk>eciesjs>secp256k1": false
}
}
}
}
10 changes: 10 additions & 0 deletions src/theme/Footer/index.js
Original file line number Diff line number Diff line change
@@ -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(() => {
Expand All @@ -14,6 +16,14 @@ export default function FooterWrapper(props) {
cookieBtn.removeEventListener("click", handleManageCookie);
};
}, []);

const isBrowser = useIsBrowser();
if (isBrowser) {
Intercom({
app_id: 'txttgas6'
});
}

return (
<>
<Footer {...props} />
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2597,6 +2597,13 @@ __metadata:
languageName: node
linkType: hard

"@intercom/messenger-js-sdk@npm:^0.0.11":
version: 0.0.11
resolution: "@intercom/messenger-js-sdk@npm:0.0.11"
checksum: 1b89cdfab5d332900101d9d9439fbbf654777c4d17027a654aa0a31d53bf6e9e3c08c7faa7939eed8c1b75a8b36ee6a93d05bf7bddd81edb4aae91a8f1939162
languageName: node
linkType: hard

"@isaacs/cliui@npm:^8.0.2":
version: 8.0.2
resolution: "@isaacs/cliui@npm:8.0.2"
Expand Down Expand Up @@ -13360,6 +13367,7 @@ __metadata:
"@docusaurus/theme-mermaid": ^3.0.0
"@docusaurus/tsconfig": ^3.4.0
"@docusaurus/types": ^3.4.0
"@intercom/messenger-js-sdk": ^0.0.11
"@lavamoat/allow-scripts": ^3.0.4
"@mdx-js/react": ^3.0.0
"@metamask/design-tokens": ^1.11.1
Expand Down

0 comments on commit 16ed267

Please sign in to comment.