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

Open ReactionPicker on Message LongPress, without opening the context menu first #108

Closed
mckenziefiege opened this issue Jan 3, 2020 · 4 comments
Assignees

Comments

@mckenziefiege
Copy link

We are looking to rewrite the existing functionality of the openReactionSelector in the MessageContent component. Instead of the long press to open the menu and then having to click on “Add Reaction”, we would like to have the longPress immediately open the reaction picker.

In order to achieve this - we have tried creating a custom component for MessageSimple and MessageContent where our custom MessageSimple component would render the custom MessageContent component. However, it seems to be an endless cycle of having to create custom components (ex: ReactionPicker and MessageReplies) which can not be imported. Is there a way to adjust the openReactionSelector function without having to create custom components?

@vishalnarkhede vishalnarkhede self-assigned this Jan 3, 2020
@vishalnarkhede
Copy link
Contributor

Hey @mckenziefiege thanks for bringing this to our attention. Let me get back to you on this one in few hours!!

@vishalnarkhede
Copy link
Contributor

vishalnarkhede commented Jan 6, 2020

Hey @mckenziefiege , we will be publishing a change tomorrow. With that change you will be able to customize the required onLongPress or onPress behaviour as following:

import { MessageSimple } from 'stream-chat-react-native' // or 'stream-chat-expo'
...
const MessageUIComponent = (props) => {
 return (
   <MessageSimple
     {...props}
     onLongPress={(thisArg, message, e) => {
       thisArg.openReactionSelector();
       // Similarly, you can also call other methods available on MessageContent
       // component such as handleEdit, handleDelete, showActionSheet
       // Source - https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageContent.js
     }}
 )
}

Please let us know if this will solve your issue!!

@vishalnarkhede
Copy link
Contributor

Hey @mckenziefiege ,

This has been been published - v0.6.0

Please let us know if it solves your issue!! :)

@mckenziefiege
Copy link
Author

@vishalnarkhede Works great! Thank you! :)

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

No branches or pull requests

2 participants