I'm using fake widget unitl user click on it and run intercom chat. Before I implemented it, I used intercom chat by other buttons on webpage, but now it doesn't work and I'm wondering how I cab fix it, how I can run this fake widget by clicking another button on the page?
fake widget: LiveChatLoaderProvider
Before in _app.js I used this component:
import {IntercomProvider} from "react-use-intercom";
const IntercomWrapper = () => {
let INTERCOM_KEY = process.env.NEXT_PUBLIC_INTERCOM_KEY;
return (
<IntercomProvider appId={INTERCOM_KEY} autoBoot>
</IntercomProvider>
)
};
export default IntercomWrapper;
and on other button worked by this:
let openIntercom = function (e) {
e.preventDefault();
window.Intercom("show");
};
now I use in _app.js:
import { LiveChatLoaderProvider, Intercom } from "react-live-chat-loader";
const IntercomWrapper = () => {
let INTERCOM_KEY = process.env.NEXT_PUBLIC_INTERCOM_KEY;
return (
<LiveChatLoaderProvider
providerKey={INTERCOM_KEY}
provider="intercom"
>
<Intercom color="#0085E9" />
</LiveChatLoaderProvider>
);
};
and don't know how to run it but click other buttons than this fake widget one.
If anyone could help, I would be greatfull.
Also I tried to run just IntercomProvider in other button (the same I used before implemented fake widget) but in this case I can not close intercom chat, it seems, the fake one is in the same place and block intercom button. Of course if I just run intercom chat by clicking in the fake button it works fine.
Website is built using react / nextjs