stream-chat-react-native
stream-chat-react-native copied to clipboard
Add onLongPress Event Handler in ChannelList
Being able to launch a modal onLongPress in ChannelList So that, it gets easier to manage channel like pinning, deleting etc straight from the channelList
Probable Approach
May be a modified onSelect or implement native flatList's onLongPress function into additionalFlatListProps that will return a callback
Hey team! Please add your planning poker estimate with Zenhub @santhoshvai @madsroskar @khushal87
@asRizvi888 Here is an alternative solutions you can implement.
import { ChannelList, ChannelPreviewMessenger } from 'stream-chat-react-native';
import { TouchableOpacity } from 'react-native';
<ChannelList
filters={filters}
sort={sort}
Preview={(props) => (
<TouchableOpacity
onLongPress={() => console.log('LONG PRESSED', props.channel.id)}
onPress={() => {
navigation.navigate('ChannelScreen', {
channel: props.channel,
});
}}
>
<ChannelPreviewMessenger {...props} />
</TouchableOpacity>
)}
/>
I am going to close this for now. The solution recommended above has been tested and seems to be working on our end. Please feel free to get back to us if you face any issues.