stream-chat-react-native icon indicating copy to clipboard operation
stream-chat-react-native copied to clipboard

Add onLongPress Event Handler in ChannelList

Open asRizvi888 opened this issue 3 years ago • 1 comments

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

asRizvi888 avatar Aug 19 '22 03:08 asRizvi888

Hey team! Please add your planning poker estimate with Zenhub @santhoshvai @madsroskar @khushal87

vanGalilea avatar Sep 13 '22 08:09 vanGalilea

@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>
    )}
/>

vishalnarkhede avatar Nov 15 '22 18:11 vishalnarkhede

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.

vishalnarkhede avatar Nov 16 '22 10:11 vishalnarkhede