FaridSafi / react-native-gifted-chat

💬 The most complete chat UI for React Native
https://gifted.chat
MIT License
13.46k stars 3.55k forks source link

GiftedChat image next to chat #1936

Closed matiaseche closed 3 years ago

matiaseche commented 3 years ago

Issue Description

I've been trying to add a like feature to my chat. Right now, if I longPress a message, it will display a menu with a like option (couldn't do it with a double tap), and a small image of a heart will be added to that message, it would be great if this could be done with an emoji. My problem is that I want the heart to be next to the text rather than on top.

Steps to Reproduce / Code Snippets

function handleLongPress(context, message) {
    const options = [
      'Like',
      'Cancel',
    ];
    const cancelButtonIndex = options.length - 1;
    const messages2 = messages.filter(({ _id }) => _id != message._id)
    // if ((!message.like) && (message.user._id != userId)) {
    if (!message.like) {
      context.actionSheet().showActionSheetWithOptions({
        options,
        cancelButtonIndex,
      },
      (buttonIndex: any) => {
        switch (buttonIndex) {
          case 0:
            message.like = true
            message.image = 'https://banner2.cleanpng.com/20180318/plw/kisspng-love-heart-love-heart-romance-clip-art-picture-of-red-heart-5aaeb7181ca327.7123730415213995761173.jpg';
            const updatedMessages: MyMessage[] = GiftedChat.append(messages2, message);
            break;
        }
      });

    }
  }

Expected Results

photo_2020-10-01_12-17-47

Additional Information

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.