Created sider for Chat messages.

This commit is contained in:
Patrick Fic
2020-01-31 14:42:54 -08:00
parent e2518a95ab
commit 55cec20914
4 changed files with 69 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
import React from "react";
export default function ChatWindowComponent() {
return <div>Chat Windows and more</div>;
import { Drawer } from "antd";
export default function ChatWindowComponent({ ...drawerProps }) {
return <Drawer {...drawerProps}>Chat Windows and more</Drawer>;
}

View File

@@ -6,7 +6,7 @@ import { createStructuredSelector } from "reselect";
import { selectCurrentUser } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser
//currentUser: selectCurrentUser
});
const mapDispatchToProps = dispatch => ({
@@ -16,18 +16,17 @@ const mapDispatchToProps = dispatch => ({
export default connect(
mapStateToProps,
mapDispatchToProps
)(function ChatWindowContainer({ currentUser }) {
)(function ChatWindowContainer() {
const [visible, setVisible] = useState(false);
return (
<div style={{ position: "absolute", zIndex: 1000 }}>
{visible ? <ChatWindowComponent /> : null}
<Button
onClick={() => {
setVisible(!visible);
}}
>
Open!
</Button>
<div>
<Button onClick={() => setVisible(!visible)}>Drawer!</Button>
<ChatWindowComponent
mask={false}
maskClosable={false}
visible={visible}
zIndex={0}
/>
</div>
);
});