Created sider for Chat messages.
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user