@jeffersonl-surge/react-chat-ui
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -25,7 +25,7 @@ "use strict"; | ||
BubbleGroup.prototype.renderGroup = function (messages, id) { | ||
var _a = this.props, bubblesCentered = _a.bubblesCentered, bubbleStyles = _a.bubbleStyles, showSenderName = _a.showSenderName, chatBubble = _a.chatBubble, senderName = _a.senderName; | ||
var _a = this.props, bubblesCentered = _a.bubblesCentered, bubbleStyles = _a.bubbleStyles, showSenderName = _a.showSenderName, chatBubble = _a.chatBubble, senderName = _a.senderName, classNameArray = _a.classNameArray; | ||
var ChatBubble = chatBubble || ChatBubble_1.default; | ||
var sampleMessage = messages[0]; | ||
var messageNodes = messages.map(function (message, i) { | ||
return (React.createElement(ChatBubble, { key: i, message: message, bubblesCentered: bubblesCentered, bubbleStyles: bubbleStyles })); | ||
return (React.createElement(ChatBubble, { key: i, message: message, bubblesCentered: bubblesCentered, bubbleStyles: bubbleStyles, classNameString: classNameArray && classNameArray.length > i ? classNameArray[i] : undefined })); | ||
}); | ||
@@ -32,0 +32,0 @@ return (React.createElement("div", { style: styles_1.default.chatbubbleWrapper }, |
@@ -9,2 +9,3 @@ import { Message, ChatBubble } from '../'; | ||
bubbleStyles: any; | ||
classNameArray?: string[]; | ||
} |
@@ -49,3 +49,3 @@ "use strict"; | ||
return (React.createElement("div", { style: __assign({}, styles_1.default.chatbubbleWrapper) }, | ||
React.createElement("div", { style: chatBubbleStyles }, | ||
React.createElement("div", { style: chatBubbleStyles, className: this.props.classNameString || "" }, | ||
React.createElement("p", { style: __assign({}, styles_1.default.p, text), dangerouslySetInnerHTML: { __html: this.props.message.message } })))); | ||
@@ -52,0 +52,0 @@ }; |
@@ -10,2 +10,3 @@ import Message from '../Message'; | ||
bubblesCentered: boolean; | ||
className?: string; | ||
} |
@@ -13,2 +13,3 @@ import * as React from 'react'; | ||
chatBubble?: React.Component; | ||
classNameArray?: string[]; | ||
}; | ||
@@ -15,0 +16,0 @@ } |
@@ -51,11 +51,17 @@ "use strict"; | ||
ChatFeed.prototype.renderMessages = function (messages) { | ||
var _this = this; | ||
var _a = this.props, isTyping = _a.isTyping, bubbleStyles = _a.bubbleStyles, chatBubble = _a.chatBubble, showSenderName = _a.showSenderName; | ||
var ChatBubble = chatBubble || ChatBubble_1.default; | ||
var group = []; | ||
var classNamesForGroup = []; | ||
var messageNodes = messages.map(function (message, index) { | ||
group.push(message); | ||
if (_this.props.classNameArray && _this.props.classNameArray.length > index) { | ||
classNamesForGroup.push(_this.props.classNameArray[index]); | ||
} | ||
if (index === messages.length - 1 || messages[index + 1].id !== message.id) { | ||
var messageGroup = group; | ||
var messageGroupClassNameArray = classNamesForGroup; | ||
group = []; | ||
return (React.createElement(BubbleGroup_1.default, { key: index, messages: messageGroup, id: message.id, showSenderName: showSenderName, chatBubble: ChatBubble, bubbleStyles: bubbleStyles })); | ||
return (React.createElement(BubbleGroup_1.default, { key: index, messages: messageGroup, id: message.id, showSenderName: showSenderName, chatBubble: ChatBubble, bubbleStyles: bubbleStyles, classNameArray: messageGroupClassNameArray.length > 0 ? messageGroupClassNameArray : undefined })); | ||
} | ||
@@ -62,0 +68,0 @@ return null; |
{ | ||
"name": "@jeffersonl-surge/react-chat-ui", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A library of React components for building chat UI's", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/jefferson-surge/react-chat-ui", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
57549
501
0