Replaced remaining parts of app to use Redux.
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import React from "react";
|
||||
import { useQuery } from "react-apollo";
|
||||
import { Link } from "react-router-dom";
|
||||
import { GET_CURRENT_USER } from "../../graphql/local.queries";
|
||||
import { Icon } from "antd";
|
||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { Link } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
|
||||
@@ -12,28 +9,19 @@ const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
// signOutStart: () => dispatch(signOutStart())
|
||||
});
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
null
|
||||
)(function ManageSignInButton({ currentUser }) {
|
||||
return currentUser.isAuthorized ? (
|
||||
<div>
|
||||
{" "}
|
||||
<Link to="/manage">
|
||||
<Icon type="build" />
|
||||
Manage
|
||||
</Link>
|
||||
</div>
|
||||
return currentUser.authorized ? (
|
||||
<Link to="/manage">
|
||||
<Icon type="build" />
|
||||
Manage
|
||||
</Link>
|
||||
) : (
|
||||
<div>
|
||||
<Link to="/signin">
|
||||
<Icon type="login" />
|
||||
Sign In
|
||||
</Link>
|
||||
</div>
|
||||
<Link to="/signin">
|
||||
<Icon type="login" />
|
||||
Sign In
|
||||
</Link>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user