/*
import {connect} from "react-redux";
import * as actions from "./actions";
import LoginForm from "./components/LoginForm";
*/
export class Login extends Component {
render() {
return (
<LoginForm
onLogin={this.props.authenticate}
isAuthenticated={this.props.isAuthenticated}
/>
);
}
}
export const mapStateToProps = (state) => {
return {
isAuthenticated: state.authentication.isAuthenticated
}
};
export const mapDispatchToProps = (dispatch) => {
return {
authenticate: () => {
dispatch(actions.authenticate())
}
}
};
Login.propTypes = {
authenticate: PropTypes.func,
isAuthenticated: PropTypes.bool.isRequired
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(Login);