28 lines
655 B
JavaScript
28 lines
655 B
JavaScript
import { Icon } from "antd";
|
|
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";
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
currentUser: selectCurrentUser
|
|
});
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
null
|
|
)(function ManageSignInButton({ currentUser }) {
|
|
return currentUser.authorized ? (
|
|
<Link to="/manage">
|
|
<Icon type="build" />
|
|
Manage
|
|
</Link>
|
|
) : (
|
|
<Link to="/signin">
|
|
<Icon type="login" />
|
|
Sign In
|
|
</Link>
|
|
);
|
|
});
|