33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
import { Affix } from "antd";
|
|
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import { createStructuredSelector } from "reselect";
|
|
import { selectConversations } from "../../redux/messaging/messaging.selectors";
|
|
import ChatConversationContainer from "../chat-conversation/chat-conversation.container";
|
|
import ChatMessagesButtonContainer from "../chat-messages-button/chat-messages-button.container";
|
|
import "./chat-dock.styles.scss";
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
activeConversations: selectConversations
|
|
});
|
|
|
|
export function ChatOverlayContainer({ activeConversations }) {
|
|
return (
|
|
<Affix offsetBottom={0}>
|
|
<div className='chat-dock'>
|
|
<ChatMessagesButtonContainer />
|
|
{activeConversations
|
|
? activeConversations.map(conversation => (
|
|
<ChatConversationContainer
|
|
conversation={conversation}
|
|
key={conversation.id}
|
|
/>
|
|
))
|
|
: null}
|
|
</div>
|
|
</Affix>
|
|
);
|
|
}
|
|
|
|
export default connect(mapStateToProps, null)(ChatOverlayContainer);
|