Closed Spiral-Memory closed 5 days ago
Hey @sidmohanty11 ,
This PR is ready for review. It fixes some minor issues and mainly adds a feature to remotely configure the props. I've explained its workings in the PR description. Please take a look.
Thanks!
Brief Title
This PR adds a feature to remotely configure EmbeddedChat using the EmbeddedChat RC app.
Acceptance Criteria Fulfillment
useRemoteProps
hook that overrides the existing props if any of the props match those in the remote configurationThe implementation is simple: before displaying the EmbeddedChat, we fetch the remote props from EC settings. If a new prop is present or an existing one needs to be overridden, it overrides the prop and then shows the EmbeddedChat component. These overrides happen only when
remoteOpt
is passed as true.We can't directly mutate the props, so I have added a state config that now handles the props accordingly.
Fixes #597
Video/Screenshots
https://github.com/RocketChat/EmbeddedChat/assets/78961432/8f2e5027-2a8d-4723-8c2b-33ae7cbf9336