import React, { PropTypes } from 'react'; import { reduxForm } from 'redux-form'; import { validateAndLoginUser } from '../actions'; import LoginForm from '../components/LoginForm'; // import GithubButton from '../components/GithubButton'; import { Link, browserHistory } from 'react-router'; import InlineSVG from 'react-inlinesvg'; const exitUrl = require('../../../images/exit.svg'); const logoUrl = require('../../../images/p5js-logo.svg'); class LoginView extends React.Component { constructor(props) { super(props); this.closeLoginPage = this.closeLoginPage.bind(this); this.gotoHomePage = this.gotoHomePage.bind(this); } closeLoginPage() { browserHistory.push(this.props.previousPath); } gotoHomePage() { browserHistory.push('/'); } render() { return (

Log In

{/*

Or

*/}

Don't have an account?  Sign Up

Forgot your password?  Reset your password

); } } function mapStateToProps(state) { return { user: state.user, previousPath: state.ide.previousPath }; } function mapDispatchToProps() { return { validateAndLoginUser }; } function validate(formProps) { const errors = {}; if (!formProps.email) { errors.email = 'Please enter an email'; } if (!formProps.password) { errors.password = 'Please enter a password'; } return errors; } LoginView.propTypes = { previousPath: PropTypes.string.isRequired }; export default reduxForm({ form: 'login', fields: ['email', 'password'], validate }, mapStateToProps, mapDispatchToProps)(LoginView);