Giter Club home page Giter Club logo

react-web-gifted-chat's Introduction

Gifted Chat

Web fork of most complete chat UI for React Web (formerly known as Gifted Messenger).

Demo is available here

Article

The article how to create working chat in 20 minutes is available on medium - here

Features

  • Fully customizable components
  • Composer actions (to attach photos, etc.)
  • Load earlier messages
  • Copy messages to clipboard
  • Touchable links using react-native-parsed-text
  • Avatar as user's initials
  • Localized dates
  • Multiline TextInput
  • InputToolbar avoiding keyboard

Installation

  • Using npm: npm install react-web-gifted-chat --save
  • Using Yarn: yarn add react-web-gifted-chat

Example

import { GiftedChat } from 'react-web-gifted-chat';

class Example extends React.Component {

  state = {
    messages: [],
  };

  componentWillMount() {
    this.setState({
      messages: [
        {
          id: 1,
          text: 'Hello developer',
          createdAt: new Date(),
          user: {
            id: 2,
            name: 'React',
            avatar: 'https://facebook.github.io/react/img/logo_og.png',
          },
        },
      ],
    });
  }

  onSend(messages = []) {
    this.setState((previousState) => ({
      messages: GiftedChat.append(previousState.messages, messages),
    }));
  }

  render() {
    return (
      <GiftedChat
        messages={this.state.messages}
        onSend={(messages) => this.onSend(messages)}
        user={{
          id: 1,
        }}
      />
    );
  }

}

Advanced example

See example/App.js for a working demo!

Message object

e.g.

{
  id: 1,
  text: 'My message',
  createdAt: new Date(Date.UTC(2016, 5, 11, 17, 20, 0)),
  user: {
    id: 2,
    name: 'React',
    avatar: 'https://facebook.github.io/react/img/logo_og.png',
  },
  image: 'https://facebook.github.io/react/img/logo_og.png',
  // Any additional custom parameters are passed through
}

Props

  • messages (Array) - Messages to display
  • text (String) - Input text; default is undefined, but if specified, it will override GiftedChat's internal state (e.g. for redux; see notes below)
  • placeholder (String) - Placeholder when text is empty; default is 'Type a message...'
  • messageIdGenerator (Function) - Generate an id for new messages. Defaults to UUID v4, generated by uuid
  • user (Object) - User sending the messages: { _id, name, avatar }
  • onSend (Function) - Callback when sending a message
  • locale (String) - Locale to localize the dates
  • timeFormat (String) - Format to use for rendering times; default is 'LT'
  • dateFormat (String) - Format to use for rendering dates; default is 'll'
  • isAnimated (Bool) - Animates the view when the keyboard appears
  • loadEarlier (Bool) - Enables the "Load earlier messages" button
  • onLoadEarlier (Function) - Callback when loading earlier messages
  • isLoadingEarlier (Bool) - Display an ActivityIndicator when loading earlier messages
  • renderLoading (Function) - Render a loading view when initializing
  • renderLoadEarlier (Function) - Custom "Load earlier messages" button
  • renderAvatar (Function) - Custom message avatar; set to null to not render any avatar for the message
  • showUserAvatar (Bool) - Whether to render an avatar for the current user; default is false, only show avatars for other users
  • showAvatarForEveryMessage (Bool) - When false, avatars will only be displayed when a consecutive message is from the same user on the same day; default is false
  • onPressAvatar (Function(user)) - Callback when a message avatar is tapped
  • renderAvatarOnTop (Bool) - Render the message avatar at the top of consecutive messages, rather than the bottom; default is false
  • renderBubble (Function) - Custom message bubble
  • renderSystemMessage (Function) - Custom system message
  • onLongPress (Function(context, message)) - Callback when a message bubble is long-pressed; default is to show an ActionSheet with "Copy Text" (see example using showActionSheetWithOptions())
  • inverted (Bool) - Reverses display order of messages; default is true
  • renderMessage (Function) - Custom message container
  • renderMessageText (Function) - Custom message text
  • renderMessageImage (Function) - Custom message image
  • imageProps (Object) - Extra props to be passed to the <Image> component created by the default renderMessageImage
  • videoProps (Object) - Extra props to be passed to the <Video> component created by the default renderMessageVideo
  • lightboxProps (Object) - Extra props to be passed to the MessageImage's Lightbox
  • renderCustomView (Function) - Custom view inside the bubble
  • renderDay (Function) - Custom day above a message
  • renderTime (Function) - Custom time inside a message
  • renderFooter (Function) - Custom footer component on the ListView, e.g. 'User is typing...'; see example/App.js for an example
  • renderChatFooter (Function) - Custom component to render below the MessageContainer (separate from the ListView)
  • renderInputToolbar (Function) - Custom message composer container
  • renderComposer (Function) - Custom text input message composer
  • renderActions (Function) - Custom action button on the left of the message composer
  • renderSend (Function) - Custom send button; you can pass children to the original Send component quite easily, for example to use a custom icon (example)
  • renderAccessory (Function) - Custom second line of actions below the message composer
  • onPressActionButton (Function) - Callback when the Action button is pressed (if set, the default actionSheet will not be used)
  • bottomOffset (Integer) - Distance of the chat from the bottom of the screen (e.g. useful if you display a tab bar)
  • minInputToolbarHeight (Integer) - Minimum height of the input toolbar; default is 44
  • listViewProps (Object) - Extra props to be passed to the messages <ListView>; some props can't be overridden, see the code in MessageContainer.render() for details
  • textInputProps (Object) - Extra props to be passed to the <TextInput>
  • keyboardShouldPersistTaps (Enum) - Determines whether the keyboard should stay visible after a tap; see <ScrollView> docs
  • onInputTextChanged (Function) - Callback when the input text changes
  • maxInputLength (Integer) - Max message composer TextInput length
  • parsePatterns (Function) - Custom parse patterns for react-native-parsed-text used to linkify message content (like URLs and phone numbers), e.g.:
  • extraData (Object) - Extra props for re-rendering FlatList on demand. This will be useful for rendering footer etc.
  • minComposerHeight (Object) - Custom min height of the composer.
  • maxComposerHeight (Object) - Custom max height of the composer.

License

Notes for local development

You need to have facebook watchman installed

  1. cd example
  2. yarn
  3. yarn start
  4. yarn run sync in another terminal window (doesn't matter where)

If you have any issues, you can clear your watches using watchman watch-del-all and try again.

Author

Feel free to ask me question on Twitter @JanRomaniak!

react-web-gifted-chat's People

Contributors

alizbazar avatar apparition47 avatar bencollab avatar bookercodes avatar bpeters avatar brianinator avatar brunocascio avatar burgalon avatar cooperka avatar davidleonardi avatar doomsower avatar erenn16 avatar faridsafi avatar fengliu222 avatar gnl avatar greenkeeper[bot] avatar ianlin avatar jayshah123 avatar jeromegrosse avatar johniak avatar kesha-antonov avatar kfiroo avatar koppelaar avatar luhui avatar nandiniparimi1107 avatar scarmuega avatar shauns avatar swapkats avatar tafelito avatar xcarpentier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-web-gifted-chat's Issues

Appears to be dependent on react-native.

Issue Description

Webpack can't build as it looks for react-native

Steps to Reproduce / Code Snippets

Add to a project and build with webpack 3 and babel 6

Expected Results

Errr, works?

Additional Information

  • React Native version: Ummm the web so none?
  • react-native-gifted-chat version: react-web-gifted-chat
  • Platform(s) (iOS, Android, or both?): um chrome.

Message list overflow not working on Firefox

I think this is a known bug of Firefox: when you use a flexbox with column-reverse or row-reverse, the overflow doesn't work.
In this case the message list will expand outside the container div, because messega bubbles are inside a column-reverse flexbox
Here is a screenshot of the demo application
bug chat
With overflow working properly the scrollbar would be inside the bubbles container, not at the edge of the page.
Is there a workaround to make it work even on Firefox?

error due to absolute paths in distributed package

Issue Description

Module not found: Can't resolve '/Users/johniak/Projects/react-web-gifted-chat/node_modules/@babel/runtime/helpers/esm/assertThisInitialized' in '/home/katie/repos/ampere/walnut-web/node_modules/react-web-gifted-chat/dist'

Not working

Issue Description

It isnt working

Steps to Reproduce / Code Snippets

<GiftedChat messages={messages} onSend={handleSend} user={{ id: user.uid, name: user.displayName, avatar: user.photoURL }} renderBubble={renderBubble} placeholder='Type your message here...' isTyping= {true} renderSend={renderSend} scrollToBottom scrollToBottomComponent={scrollToBottomComponent} renderSystemMessage={renderSystemMessage} renderUsernameOnMessage={true} showUserAvatar={true} renderAvatarOnTop={true} />

Expected Results

to bring out the chatting window or at least an error

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: [FILL THIS OUT]
  • react-web-gifted-chat version: [FILL THIS OUT]
  • Browser(s) (Chrome, etc.): [FILL THIS OUT]

Can't resolve 'react-web-gifted-chat'

I get this error when i start the example application

Can't resolve 'react-web-gifted-chat in ./src/App.js

Steps to Reproduce

  • Download package from github
  • open terminal and go to the example folder
  • yarn
  • yarn start

How to configure gift-chat to send message when enter key is pressed?

Issue Description

[FILL THIS OUT]

Steps to Reproduce / Code Snippets

[FILL THIS OUT]

Expected Results

[FILL THIS OUT]

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: [FILL THIS OUT]
  • react-web-gifted-chat version: [FILL THIS OUT]
  • Browser(s) (Chrome, etc.): [FILL THIS OUT]

NOT RENDERING ANYTHING

Issue Description

Gifted chat not rendering any thing

Steps to Reproduce / Code Snippets

<GiftedChat
Screenshot (53)

      messages={messages}
      onSend={_handleSend}
      user={{
        id: currentUserId,
      }}
    />

Expected Results

empty screen

Additional Information

  • Nodejs version: 16
  • React version: 18
  • react-web-gifted-chat version: 0.6.7
  • Browser(s) (Chrome, etc.): firefox

Warning: findDOMNode is deprecated in StrictMode.

Issue Description

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of View which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node
    in div (created by View)
    in View (created by GiftedChat)
    in GiftedChat (at ChatComponent.js:48)
    in div (at CardComponent.js:9)
    in Card (at ChatComponent.js:46)
    in div (at CardComponent.js:9)
    in Card (at ChatComponent.js:45)
    in article (at ArticleCardComponent.js:9)
    in ArticleCard (at ChatComponent.js:44)
    in div (at CardComponent.js:9)
    in Card (at ChatComponent.js:40)
    in ChatScreen (at App.js:40)
    in div (at CardComponent.js:9)
    in Card (at WrapperComponent.js:10)
    in main (at WrapperComponent.js:9)
    in Wrapper (at App.js:38)
    in Router (created by BrowserRouter)
    in BrowserRouter (at App.js:37)
    in App (at src/index.js:10)
    in StrictMode (at src/index.js:9)

Steps to Reproduce / Code Snippets

import { GiftedChat } from 'react-web-gifted-chat';
function ChatScreen(props){

    const [messages, setMessages] = useState(null);

    let {header, children, ...rest} = props;

    /*
    messages: [
        {
          id: 1,
          text: 'Hello developer',
          createdAt: new Date(),
          user: {
            id: 2,
            name: 'React',
            avatar: 'https://facebook.github.io/react/img/logo_og.png',
          },
        },
      ],
    
    */ 

   let onSend = (messages = []) => {
        setMessages((previousState) => ({
            messages: GiftedChat.append(previousState.messages, messages),
        }));
   }

    
    return(
        <Card className="col-md-8">
            <Card className="row">
                {header}
            </Card>
            <ArticleCard className="row">
              <Card className="chat-colunm-wrapper py-3 col-md-12">
                <Card className="chat-window row">
                  
                  <GiftedChat
                    messages={messages}
                    onSend={(messages) => onSend(messages)}
                    user={{
                      id: 1,
                  }}/>
                  
                </Card>
              </Card>
            </ArticleCard>
            <ReplyBar/>
        </Card>
    )
    
} 

export default ChatScreen;

Additional Information

  • Nodejs version: v12.18.4
  • React version: 16.13.1
  • react-web-gifted-chat version: 0.6.7
  • Browser(s) (Chrome, etc.): Chrome

Can't resolve 'react-dom/lib/EventPluginHub'

Issue Description

After trying the example with import { GiftedChat } from 'react-web-gifted-chat';

Steps to Reproduce / Code Snippets

Doing example

Expected Results

The example

Additional Information

Got error: import { GiftedChat } from 'react-web-gifted-chat';

"react": "^16.0.0",
"react-dom": "^16.0.0",

"react-web-gifted-chat": "0.0.4",

On web

<div> component error

Issue Description

When I type something this error occurs at the moment

The above error occurred in the <div> component:
    in div (created by TouchableOpacity)
    in TouchableOpacity (created by Send)
    in Send (created by InputToolbar)
    in div (created by View)
    in View (created by InputToolbar)
    in div (created by View)
    in View (created by InputToolbar)
    in InputToolbar (created by GiftedChat)
    in div (created by View)
    in View (created by GiftedChat)
    in GiftedChat (at Message.tsx:165)
    in Message (created by WithStyles(Message))
    in WithStyles(Message) (created by Context.Consumer)
    in Connect(WithStyles(Message)) (at Chat.tsx:135)
    in div (at Chat.tsx:134)
    in div (created by SplitterPane)
    in SplitterPane (created by Splitter)
    in div (created by Splitter)
    in Splitter (at Chat.tsx:125)
    in div (at Chat.tsx:124)
    in Chat (created by WithStyles(Chat))
    in WithStyles(Chat) (created by Context.Consumer)
    in Connect(WithStyles(Chat)) (created by Route)
    in Route (at App.tsx:40)
    in Switch (at App.tsx:38)
    in main (at App.tsx:37)
    in div (at App.tsx:36)
    in App (created by WithStyles(App))
    in WithStyles(App) (at src/index.tsx:23)
    in MuiThemeProviderOld (at src/index.tsx:21)
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by Context.Consumer)
    in ConnectedRouterWithContext (created by Context.Consumer)
    in Connect(ConnectedRouterWithContext) (at src/index.tsx:20)
    in PersistGate (at src/index.tsx:19)
    in Provider (at src/index.tsx:18)
Uncaught TypeError: Failed to set an indexed property on 'CSSStyleDeclaration': Index property setter is not supported.
    at setValueForStyles (react-dom.development.js:6713)
    at setInitialDOMProperties (react-dom.development.js:7855)
    at setInitialProperties (react-dom.development.js:8084)
    at finalizeInitialChildren (react-dom.development.js:9158)
    at completeWork (react-dom.development.js:17644)
    at completeUnitOfWork (react-dom.development.js:20108)
    at performUnitOfWork (react-dom.development.js:20315)
    at workLoop (react-dom.development.js:20326)
    at renderRoot (react-dom.development.js:20406)
    at performWorkOnRoot (react-dom.development.js:21363)
    at performWork (react-dom.development.js:21273)
    at flushInteractiveUpdates$1 (react-dom.development.js:21540)
    at batchedUpdates (react-dom.development.js:2260)
    at dispatchEvent (react-dom.development.js:5110)
    at react-dom.development.js:21526
    at Object.unstable_runWithPriority (scheduler.development.js:255)
    at interactiveUpdates$1 (react-dom.development.js:21525)
    at interactiveUpdates (react-dom.development.js:2268)
    at dispatchInteractiveEvent (react-dom.development.js:5086)

[FILL THIS OUT]

Steps to Reproduce / Code Snippets

[FILL THIS OUT]

Expected Results

[FILL THIS OUT]

Additional Information

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2019-05-11 แ„‹แ…ฉแ„’แ…ฎ 6 03 28

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2019-05-11 แ„‹แ…ฉแ„’แ…ฎ 6 03 39

  • Nodejs version:
  • React version: 16.7.0
  • react-web-gifted-chat version: 0.6.4
  • Browser(s) (Chrome, etc.): chrome 74.0.3729.131

Message list doesn't update when messages change

Issue Description

When a message is updated, for example changing the status from sent to received, the message list is not updated.
The problem is inside MessageContainer

shouldComponentUpdate(nextProps) { const next = nextProps.messages; const current = this.props.messages; return ( next.length !== current.length || next.extraData !== current.extraData || next.loadEarlier !== current.loadEarlier ); }

If i set received props of a message to true, (next.length !== current.length) this condition prevent the list from updating correctly.

Unknown event handler warnings

Issue Description

When using react-web-gifted-chat, I see a large number of warnings (logged as errors) in my console that seem to be coming from the a child of the GiftedChat component:

Warning: Unknown event handler property onResponderGrant. It will be ignored.
Warning: Unknown event handler property onResponderMove. It will be ignored.
Warning: Unknown event handler property onResponderRelease. It will be ignored.
Warning: Unknown event handler property onResponderTerminate. It will be ignored.
Warning: Unknown event handler property onResponderTerminationRequest. It will be ignored.
Warning: Unknown event handler property onStartShouldSetResponder. It will be ignored.
Warning: Unknown event handler property onStartShouldSetResponderCapture. It will be ignored.
Warning: Unknown event handler property onScrollShouldSetResponder. It will be ignored.
Warning: Unknown event handler property onResponderReject. It will be ignored.

Steps to Reproduce / Code Snippets

Use the GiftedChat component as documented

Expected Results

No warning spam

Additional Information

  • Nodejs version: 10.14.0
  • React version: 16.8.0-alpha.1
  • react-web-gifted-chat version: 0.6.2
  • Browser(s) (Chrome, etc.): Chrome 70.0.3538.110

quick replies?

Issue Description

Hi,

When trying the quick replies feature from the original gifted chat, i get
Warning: Each child in a list should have a unique "key" prop.
Check the render method of WebScrollView
any ideas?

thanks!!

Steps to Reproduce / Code Snippets

this is the messages
{
_id: 1,
text: 'This is a quick reply. Do you love Gifted Chat? (radio) KEEP IT',
createdAt: new Date(),
quickReplies: {
type: 'radio', // or 'checkbox',
keepIt: true,
values: [
{
title: '๐Ÿ˜‹ Yes',
value: 'yes',
},
{
title: '๐Ÿ“ท Yes, let me show you with a picture!',
value: 'yes_picture',
},
{
title: '๐Ÿ˜ž Nope. What?',
value: 'no',
},
],
},
user: {
_id: 2,
name: 'React Native',
},
},
{
_id: 2,
text: 'This is a quick reply. Do you love Gifted Chat? (checkbox)',
createdAt: new Date(),
quickReplies: {
type: 'checkbox', // or 'radio',
values: [
{
title: 'Yes',
value: 'yes',
},
{
title: 'Yes, let me show you with a picture!',
value: 'yes_picture',
},
{
title: 'Nope. What?',
value: 'no',
},
],
},
user: {
_id: 2,
name: 'React Native',
},
}

Expected Results

[FILL THIS OUT]

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: [FILL THIS OUT]
  • react-web-gifted-chat version: [FILL THIS OUT]
  • Browser(s) (Chrome, etc.): [FILL THIS OUT]

Does the renderSystemMessage work?

Issue Description

I tried to use renderSystemMessage on web, but it do nothing and doesn't call my function anyway. I looked in the library, I did not see this function in propType

Additional Information

  • Nodejs version: [8.10.0]
  • React version: [16.3.1]
  • React Native version: [0.55.2]
  • react-native-gifted-chat version:
    • react-web-gifted-chat": "^0.1.3"
    • react-native-gifted-chat": "^0.6.0"
  • Platform(s) (Web)

build fail Can't resolve 'react-native'

Issue Description

Error: Can't resolve 'react-native'

Steps to Reproduce / Code Snippets

npm run watch

ERROR in ./node_modules/react-web-gifted-chat/dist/index.js
Module not found: Error: Can't resolve 'react-native'

Expected Results

it should use 'react-native-web' instead of 'react-native' ?

Additional Information

  • Nodejs version: v10.16.3
  • React version: 16.2.0
  • react-web-gifted-chat version: 0.6.7
  • Browser(s) (Chrome, etc.): Chrome

Not able to update the state of single chat

Issue Description

Adding chat messages by simply pushing them in GiftedChat works. But when I update single value in some chat (i.e sent = true), it doesn't reflect the change. Currently what i am doing to updated the chat messages is :

updateStateOfChat = chat => {
        this.setState(previousState => ({
            messages: GiftedChat.append( [], previousState.messages.map(m => {
                if (m.id === chat.id) {
                    return {...m, sent: chat.sent};
                }
                return m;
            }))
        }));
    };

Steps to Reproduce / Code Snippets

Call the setState on any chat.

Expected Results

It should re-render the chat message that is updated.

Additional Information

  • Nodejs version: 10.15.3
  • React version: 16.9.0
  • react-web-gifted-chat version: 0.6.7
  • Browser(s) (Chrome, etc.): Chrome

Legacy context API has been detected within a strict-mode tree.

Issue Description

index.js:1 Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: GiftedChat, View

Learn more about this warning here: https://fb.me/react-legacy-context
    in GiftedChat (at ChatComponent.js:48)
    in div (at CardComponent.js:9)
    in Card (at ChatComponent.js:46)
    in div (at CardComponent.js:9)
    in Card (at ChatComponent.js:45)
    in article (at ArticleCardComponent.js:9)
    in ArticleCard (at ChatComponent.js:44)
    in div (at CardComponent.js:9)
    in Card (at ChatComponent.js:40)
    in ChatScreen (at App.js:40)
    in div (at CardComponent.js:9)
    in Card (at WrapperComponent.js:10)
    in main (at WrapperComponent.js:9)
    in Wrapper (at App.js:38)
    in Router (created by BrowserRouter)
    in BrowserRouter (at App.js:37)
    in App (at src/index.js:10)
    in StrictMode (at src/index.js:9)

Steps to Reproduce / Code Snippets

import { GiftedChat } from 'react-web-gifted-chat';
function ChatScreen(props){

    const [messages, setMessages] = useState(null);

    let {header, children, ...rest} = props;

    /*
    messages: [
        {
          id: 1,
          text: 'Hello developer',
          createdAt: new Date(),
          user: {
            id: 2,
            name: 'React',
            avatar: 'https://facebook.github.io/react/img/logo_og.png',
          },
        },
      ],
    
    */ 

   let onSend = (messages = []) => {
        setMessages((previousState) => ({
            messages: GiftedChat.append(previousState.messages, messages),
        }));
   }

    
    return(
        <Card className="col-md-8">
            <Card className="row">
                {header}
            </Card>
            <ArticleCard className="row">
              <Card className="chat-colunm-wrapper py-3 col-md-12">
                <Card className="chat-window row">
                  
                  <GiftedChat
                    messages={messages}
                    onSend={(messages) => onSend(messages)}
                    user={{
                      id: 1,
                  }}/>
                  
                </Card>
              </Card>
            </ArticleCard>
            <ReplyBar/>
        </Card>
    )
    
} 

export default ChatScreen;

Additional Information

  • Nodejs version: v12.18.4
  • React version: 16.13.1
  • react-web-gifted-chat version: 0.6.7
  • Browser(s) (Chrome, etc.): Chrome

Long Messages don't wrap with fixed width chat window

Issue Description

Long messages don't wrap with a fixed width chat window. For example "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" will not wrap, instead it goes off the screen.

Steps to Reproduce / Code Snippets

Type a really long message in chat, without any spaces

Expected Results

Chat will wrap onto many lines, but it does not. This is particularly troublesome with long links that need to be shared in chat.

Additional Information

  • Nodejs version: N/A
  • React version: Latest
  • react-web-gifted-chat version: Latest
  • Browser(s) (Chrome, etc.): All

Messages change order if some id is accidently same of two messages when other person sends message

Gifted Chats works properly. However, when we get a message from a receiver. We only know the message but not the id.
So when add the new message to existing history array. We assign a random id with this

{
id: Math.round(Math.random() * 1000000)
...
}

However, there is a slight chance that these values can be same. Which means that messages can be out of order. Kindly tell if there is any way fix this or is it a issue

Display Message not send error

Issue Description

There is no place in the documentation on how to properly display an error when a message is not sent. I believe this will be a great addition, if an error icon cant be attached beside a message that is not sent

renderUsernameOnMessage didn't work

Issue Description

Hi, i really love the way you update this react native app to be a web app- thank you for that !

My problem is when i tried to show username in the messages, and it didn't work.

Steps to Reproduce / Code Snippets

I used

  renderBubble = (props: any) => {
    return (
        <Bubble renderUsernameOnMessage {...props}></Bubble>
    );
  };

And add it to GiftedChat and still didn't work, i think it's a bug

Expected Results

See the userName in messages

Additional Information

  • Nodejs version: [12.18.1]
  • React version: [16.3.1]
  • react-web-gifted-chat version: [last- ^0.6.7]
  • Browser(s) (Chrome, etc.): [Chrome]

Can't use the example on web

Issue Description

When adding the component to a react app the app fails to compile and shows this error message:
./node_modules/react-web-gifted-chat/node_modules/react-native-parsed-text/src/ParsedText.js
Module parse failed: Unexpected token (13:2)
You may need an appropriate loader to handle this file type.
|
| const defaultParseShape = React.PropTypes.shape({
| ...ReactNative.Text.propTypes,
| type: React.PropTypes.oneOf(Object.keys(PATTERNS)).isRequired,
| });

Steps to Reproduce / Code Snippets

do the npm install and add a component to a page on your react app

Expected Results

should render the component

Additional Information

  • React Native version: There's no react native? this is a react web app
  • react-native-gifted-chat version: react-native-gifted-chat? "react-web-gifted-chat": "0.0.4"
  • Platform(s) (iOS, Android, or both?): Doesn't apply this is a web component.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.