BREAKING CHANGES: Converted to use Redux stores. Login now working using Redux.

This commit is contained in:
Patrick Fic
2020-01-31 13:20:15 -08:00
parent f1ac052a1b
commit 3060c16dd3
26 changed files with 628 additions and 360 deletions

View File

@@ -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>
);
}
});