|
@@ -10,6 +10,7 @@ import {Link, useHistory} from 'react-router-dom';
|
|
|
import { authReducer } from "../reducers/authReducer";
|
|
|
import { Redirect } from "react-router";
|
|
|
import { Nav } from "react-bootstrap";
|
|
|
+import CPromiseComponent from "../Components/PromiseComponent";
|
|
|
|
|
|
const LoginForm = ({onLogin,loggedIn}) => {
|
|
|
const [login,setLogin] = useState('')
|
|
@@ -40,27 +41,26 @@ const loginCallback = () => {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <div className="divLogin">
|
|
|
- <h4>Войти</h4>
|
|
|
- <div className="login-container">
|
|
|
- <label>Логин</label>
|
|
|
- <input value={login} onChange={e => setLogin(e.target.value)} placeholder="Логин"></input>
|
|
|
+ <div className="divLogin">
|
|
|
+ <h4>Войти</h4>
|
|
|
+ <div className="login-container">
|
|
|
+ <label>Логин</label>
|
|
|
+ <input value={login} onChange={e => setLogin(e.target.value)} placeholder="Логин"></input>
|
|
|
+ </div>
|
|
|
+ <div className='pwd-container'>
|
|
|
+ <label>Ваш текущий пароль от olx</label>
|
|
|
+ <input value={password} type={open ? "text" : "password"} onChange={e => setPassword(e.target.value)} placeholder="Пароль" />
|
|
|
+ <img src={open ? hidePwdImg : showPwdImg} onClick={() => setOpen(!open)}/>
|
|
|
+ </div>
|
|
|
+ <div className='login-container'>
|
|
|
+ <Link to='sign'>Зарегистрироваться</Link>
|
|
|
+ <Button name='Войти' isValid={isLoginValid()} callback={loginCallback} />
|
|
|
+ </div>
|
|
|
+ {show && (!login || !password) && <LoginError />}
|
|
|
</div>
|
|
|
- <div className='pwd-container'>
|
|
|
- <label>Ваш текущий пароль от olx</label>
|
|
|
- <input value={password} type={open ? "text" : "password"} onChange={e => setPassword(e.target.value)} placeholder="Пароль" />
|
|
|
- <img src={open ? hidePwdImg : showPwdImg} onClick={() => setOpen(!open)}/>
|
|
|
- </div>
|
|
|
- <div className='login-container'>
|
|
|
- <Link to='sign'>Зарегистрироваться</Link>
|
|
|
- <Button name='Войти' isValid={isLoginValid()} callback={loginCallback} />
|
|
|
- </div>
|
|
|
- {show && (!login || !password) && <LoginError />}
|
|
|
- </div>
|
|
|
-
|
|
|
)
|
|
|
}
|
|
|
|
|
|
|
|
|
-const ConnectLog = connect(state => ({loggedIn: state.authReducer.login}), {onLogin: actionFullLogin})(LoginForm)
|
|
|
+const ConnectLog = connect(state => ({loggedIn: state.authReducer}), {onLogin: actionFullLogin})(LoginForm)
|
|
|
export default ConnectLog
|