11import React from 'react' ;
2- import { Link } from 'react-router-dom' ;
3- import { Grid , Paper , Typography , withStyles , Button , Tabs , Tab , TextField } from '@material-ui/core' ;
2+ import { Grid , CircularProgress , Typography , withStyles , Button , Tabs , Tab , TextField , Fade } from '@material-ui/core' ;
43import classnames from 'classnames' ;
54
65import logo from './logo.svg' ;
@@ -31,6 +30,7 @@ const Login = ({ classes, ...props }) => (
3130 < Typography className = { classes . formDividerWord } > or</ Typography >
3231 < div className = { classes . formDivider } />
3332 </ div >
33+ < Fade in = { props . error } > < Typography color = "secondary" className = { classes . errorMessage } > Something is wrong with your login or password :(</ Typography > </ Fade >
3434 < TextField
3535 id = "email"
3636 InputProps = { { classes : { underline : classes . textFieldUnderline , input : classes . textField } } }
@@ -52,8 +52,11 @@ const Login = ({ classes, ...props }) => (
5252 fullWidth
5353 />
5454 < div className = { classes . formButtons } >
55- < Button disabled = { props . loginValue . length === 0 || props . passwordValue . length === 0 } variant = "contained" color = "primary" size = "large" > Login</ Button >
56- < Typography color = "primary" > Forget Password</ Typography >
55+ { props . isLoading
56+ ? < CircularProgress size = { 26 } className = { classes . loginLoader } />
57+ : < Button disabled = { props . loginValue . length === 0 || props . passwordValue . length === 0 } onClick = { props . handleLoginButtonClick } variant = "contained" color = "primary" size = "large" > Login</ Button >
58+ }
59+ < Button color = "primary" size = "large" className = { classes . forgetButton } > Forget Password</ Button >
5760 </ div >
5861 </ div >
5962 < Typography color = "primary" className = { classes . copyright } >
@@ -150,6 +153,9 @@ const styles = theme => ({
150153 height : 1 ,
151154 backgroundColor : theme . palette . text . hint + '40' ,
152155 } ,
156+ errorMessage : {
157+ textAlign : 'center' ,
158+ } ,
153159 textFieldUnderline : {
154160 '&:before' : {
155161 borderBottomColor : theme . palette . primary . light ,
@@ -171,6 +177,13 @@ const styles = theme => ({
171177 justifyContent : 'space-between' ,
172178 alignItems : 'center' ,
173179 } ,
180+ forgetButton : {
181+ textTransform : 'none' ,
182+ fontWeight : 400 ,
183+ } ,
184+ loginLoader : {
185+ marginLeft : theme . spacing . unit * 4 ,
186+ } ,
174187 copyright : {
175188 position : 'absolute' ,
176189 bottom : theme . spacing . unit * 2 ,
0 commit comments