BOD-14 Fixed some broken UI with temporary hard coded valeus. Added basic Chat tagging features
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user