Wolox / react-chat-widget

Awesome chat widget for your React App
MIT License
1.47k stars 458 forks source link

How to display user's name on top of the messages? Is there a way to do this? Trying to implement this for a group chat. #228

Open ayushk23 opened 4 years ago

obeka commented 4 years ago

You can pass sender or receiver name as props to the componenet in which you render the Widget, than pass that name prop into title={userName} as props. Example:

<Widget handleNewUserMessage={(newMessage) => handleNewUserMessage(newMessage)} title={Welcome to chat with ${receiver.name}.} subtitle="Traveling is a way of life." handleQuickButtonClicked={handleQuickButtonClicked} addUserMessage={addUserMessage} addResponseMessage={addResponseMessage} showTimeStamp={false} profileAvatar={${receiver.imgUrl}} />