import React from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import PropTypes from 'prop-types'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; // import Typography from '@material-ui/core/Typography'; import { login } from '../../actions'; import './LoginForm.css'; class LoginForm extends React.Component { constructor() { super(); this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit(event) { event.preventDefault(); const { dispatchLogin } = this.props; const { target } = event; const data = new FormData(target); dispatchLogin(data.get('username'), data.get('password')); } render() { const { loginError, error } = this.props; return (