BREAKING CHANGES: Converted to use Redux stores. Login now working using Redux.
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
import React, { useState } from "react";
|
||||
import ChatWindowComponent from "./chat-window.component";
|
||||
import { Button } from "antd";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
|
||||
export default function ChatWindowContainer() {
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
// signOutStart: () => dispatch(signOutStart())
|
||||
});
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(function ChatWindowContainer({ currentUser }) {
|
||||
const [visible, setVisible] = useState(false);
|
||||
return (
|
||||
<div style={{ position: "absolute", zIndex: 1000 }}>
|
||||
@@ -10,9 +24,10 @@ export default function ChatWindowContainer() {
|
||||
<Button
|
||||
onClick={() => {
|
||||
setVisible(!visible);
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
Open!
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user