BOD-14 Fixed some broken UI with temporary hard coded valeus. Added basic Chat tagging features

This commit is contained in:
Patrick Fic
2020-04-30 11:40:41 -07:00
parent dcfcf71ca4
commit bf42655186
11 changed files with 298 additions and 153 deletions

View File

@@ -4,24 +4,33 @@ import ChatMessageListComponent from "../chat-messages-list/chat-message-list.co
import ChatSendMessage from "../chat-send-message/chat-send-message.component";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component.jsx";
import AlertComponent from "../alert/alert.component";
import ChatConversationTitle from "../chat-conversation-title/chat-conversation-title.component";
export default function ChatConversationComponent({
messages,
subState,
conversation,
unreadCount,
}) {
export default function ChatConversationComponent({ subState, conversation }) {
const [loading, error] = subState;
if (loading) return <LoadingSkeleton />;
if (error) return <AlertComponent message={error.message} type='error' />;
const unreadCount =
(conversation &&
conversation &&
conversation.messages_aggregate &&
conversation.messages_aggregate.aggregate &&
conversation.messages_aggregate.aggregate.count) ||
0;
const messages =
(conversation && conversation.messages) ||
[];
return (
<div className='chat-conversation'>
<Badge count={unreadCount}>
<ChatSendMessage conversation={conversation} />
<Card size='small'>
<ChatConversationTitle conversation={conversation} />
<ChatMessageListComponent messages={messages} />
<ChatSendMessage conversation={conversation} />
</Card>
</Badge>
</div>