Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for message deletion #3

Closed
mattmezza opened this issue Mar 14, 2018 · 0 comments
Closed

support for message deletion #3

mattmezza opened this issue Mar 14, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@mattmezza
Copy link
Owner

It would be nice if react-beautiful-chat could support message deletion, here below I describe how to implement it (probably not the best way to do it: beware!):

  1. pass a function msg => { /*customCodeForDeletion()*/ } to the onDelete props in the Launcher component
  2. if the props is not null, the message components should support deletion by showing an appropriate UI element with an onClick handle that fires the passed in props passing as a parameter the msg object

By implementing this solution we would leave to the RBC user the freedom to choose whichever ID they wanna use for messages identification: they can choose to set an id property on the message object that will be given back to the onDelete function to use for the api call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant