BOD-14 More refactoring for messaging. Styles removed.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import { MessageFilled } from "@ant-design/icons";
|
||||
import { Card } from "antd";
|
||||
import { Badge, Card } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ChatConversationListContainer from "../chat-conversation-list/chat-conversation-list.container";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectChatVisible } from "../../redux/messaging/messaging.selectors";
|
||||
import { toggleChatVisible } from "../../redux/messaging/messaging.actions";
|
||||
import { selectChatVisible } from "../../redux/messaging/messaging.selectors";
|
||||
import ChatConversationListComponent from "../chat-conversation-list/chat-conversation-list.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
chatVisible: selectChatVisible
|
||||
@@ -16,19 +15,26 @@ const mapDispatchToProps = dispatch => ({
|
||||
toggleChatVisible: () => dispatch(toggleChatVisible())
|
||||
});
|
||||
|
||||
export function ChatWindowComponent({ chatVisible, toggleChatVisible }) {
|
||||
export function ChatWindowComponent({
|
||||
chatVisible,
|
||||
toggleChatVisible,
|
||||
conversationList,
|
||||
unreadCount
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Card size='small'>
|
||||
{chatVisible ? (
|
||||
<ChatConversationListContainer />
|
||||
) : (
|
||||
<div onClick={() => toggleChatVisible()}>
|
||||
<MessageFilled />
|
||||
<strong>{t("messaging.labels.messaging")}</strong>
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
<Badge count={unreadCount}>
|
||||
<Card size='small'>
|
||||
{chatVisible ? (
|
||||
<ChatConversationListComponent conversationList={conversationList} />
|
||||
) : (
|
||||
<div onClick={() => toggleChatVisible()}>
|
||||
<MessageFilled />
|
||||
<strong>{t("messaging.labels.messaging")}</strong>
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
export default connect(
|
||||
|
||||
Reference in New Issue
Block a user