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

Trouble style wrapper with ContextMenu for message in Bubble.

Open BLOCKMATERIAL opened this issue 3 years ago • 13 comments

Issue Description

Iam developing a chat room using the React-Native library,Gifted-Chat,I needed to make a context menu when I click on a message and I have a problem

I have component and it has its own size, which is larger than the wrapper of the message, I can not wrap the wrapper itself only (maybe). image

Bubble.js

`import React from 'react';
import {Bubble, MessageText} from 'react-native-gifted-chat';
import ContextMenu from 'react-native-context-menu-view';
export const renderBubble = props => {
  return (
    <ContextMenu
      actions={[
        {title: 'Pin', systemIcon: 'pin'},
        {title: 'Edit', systemIcon: 'pencil'},
        {
          title: 'Delete',
          destructive: true,
          inlineChildren: true,
          systemIcon: 'trash',
        },
      ]}
      onPress={e => {}}
      // previewBackgroundColor={'transparent'}
      previewWidth={'white'}>
      <Bubble
        {...props}
        textStyle={{
          left: {
            color: props?.name === 'dark' ? '#FFFFFF' : '#0F172A',
          },
          right: {
            color: '#FFFFFF',
          },
        }}
        wrapperStyle={{
          left: {
            backgroundColor: props?.name === 'dark' ? '#1F2937' : '#FFFFFF',
            display: 'flex',
            flexDirection: 'row',
            borderBottomLeftRadius: 0,
          },
          right: {
            backgroundColor: '#1D4ED8',
            left: 0,
            marginBottom: 15,
            borderBottomRightRadius: 0,
          },
        }}
        tickStyle={{color: '#FFFFFF'}}
        timeTextStyle={{
          left: {color: '#94A3B8'},
          right: {color: '#E2E8F0'},
        }}
      />
    </ContextMenu>
  );
};`

Additional Information

  • react-native-gifted-chat version: 0.16.3
  • Platform(s) (iOS, Android, or both?): both

BLOCKMATERIAL avatar Dec 03 '21 23:12 BLOCKMATERIAL

Sorry, but this issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. BTW Thank you for your contributions 😀 !!!

stale[bot] avatar Apr 17 '22 05:04 stale[bot]

hi, did u solved this? same problem here

fukemy avatar Apr 18 '22 14:04 fukemy

Ảnh chụp Màn hình 2022-04-18 lúc 21 31 05

fukemy avatar Apr 18 '22 14:04 fukemy

Hi community, Any update in this?

ArietNyshanbaev avatar Jun 17 '22 05:06 ArietNyshanbaev

@ArietNyshanbaev @fukemy solved the problem by wrapping the context view with its own view with its own styles.

BLOCKMATERIAL avatar Aug 24 '22 17:08 BLOCKMATERIAL

Hi, can u share some pieces of example codes? Thank so much

fukemy avatar Aug 28 '22 11:08 fukemy

@BLOCKMATERIAL Can you provide us with some sort of code sample please, would highly appreciate it.

ArietNyshanbaev avatar Oct 22 '22 08:10 ArietNyshanbaev

@BLOCKMATERIAL Can you provide us with some sort of code sample please, would highly appreciate it. I have tried to show how I solved this problem in the gist file. https://gist.github.com/BLOCKMATERIAL/3a24351f890de2f1ee411239c809320b

BLOCKMATERIAL avatar Oct 22 '22 18:10 BLOCKMATERIAL

@BLOCKMATERIALBạn có thể cung cấp cho chúng tôi một số loại mã mẫu, xin vui lòng đánh giá cao nó. Tôi đã cố gắng trình bày cách tôi giải quyết vấn đề này trong tệp gist. https://gist.github.com/BLOCKMATERIAL/3a24351f890de2f1ee411239c809320b Can I have the sample code for you? I don't know your code on git

haxuanvu870 avatar Oct 23 '22 08:10 haxuanvu870