react-live-chat-loader icon indicating copy to clipboard operation
react-live-chat-loader copied to clipboard

Support Chatwoot Expanded Bubble

Open billykwok opened this issue 2 years ago • 8 comments

This PR introduces support for Chatwoot Expanded Bubble.

Standard Bubble

This is what react-live-chat-loader already supports.

Standard Bubble

Expanded Bubble

This is what this PR adds.

Expanded Bubble

The text and the styles of the expanded bubble are applied when the new launcherTitle prop is specified. launcherTitle is the same name used in the official Chatwoot API.

billykwok avatar Mar 02 '22 01:03 billykwok

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/calibreapp/react-live-chat-loader/9viwkDhVtiWK5o9gUNiXGg5S6qHW
✅ Preview: https://react-live-chat-loader-git-fork-billykwok-cha-6c7d02-calibreapp.vercel.app

vercel[bot] avatar Mar 02 '22 01:03 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 02 '22 01:03 CLAassistant

@billykwok Thanks for your contribution 🙌

Could you update README to include the new configuration option, possibly link to the official chatwoot config option? (assuming there's a direct link)

benschwarz avatar Mar 02 '22 01:03 benschwarz

Thanks for looking at it promptly. Updated.

billykwok avatar Mar 02 '22 01:03 billykwok

@billykwok I added the new configuration option to the Chatwoot demo page, but it looks like when Chatwoot loads the configuration option isn't passed:

https://user-images.githubusercontent.com/924/156478954-14238364-00bf-42c7-9796-46a660041d07.mov

benschwarz avatar Mar 03 '22 01:03 benschwarz

To enable Expanded Bubble in the real Chatwoot widget, you also need to set the corresponding properties in the window.chatwootSettings object as per Chatwoot documentation.

It will work if you execute the following code in the dev tool console before triggering the replacement of the fake chat bubble.

window.chatwootSettings = { type: 'expanded_bubble', launcherTitle: 'Get help' };

I did not add the code for setting these properties to react-live-chat-loader because doing so would introduce a global side effect into the React component (plus the content of window.chatwootSettings also affects other features apart from Expanded Bubble).

Perhaps I could add an extra remark in README.md to remind library users to set the corresponding properties in the window.chatwootSettings object when using Expanded Bubble.

Alternatively, I can make it such that the Chatwoot component reads the window.chatwootSettings object and apply a different design automatically. But it would unfortunately make the React component depend on some global states.

billykwok avatar Mar 03 '22 03:03 billykwok

@billykwok I think a README update would be helpful. If you're able to add that documentation I'd be happy to copy edit and get it merged.

benschwarz avatar Apr 26 '22 00:04 benschwarz

Hi @benschwarz and hi @billykwok what is the status of this MR? I really like to have this feature :)

aaron5670 avatar Jun 03 '22 19:06 aaron5670