123456789101112131415161718192021 |
- import {connect} from "react-redux";
- import {useState} from "react";
- import {actionFullLogin} from "../../actions";
- const LoginForm = ({onLogin, history}) => {
- const [l, setL] = useState ('')
- const [p, setP] = useState ('')
- return (
- <div className='LoginColumn'>
- <input placeholder='Введите имя' style={{backgroundColor:"skyblue"}} onChange={e => setL(e.target.value)}></input>
- <input type='password' placeholder='Введите пароль' style={{backgroundColor:"skyblue"}} onChange={e => setP(e.target.value)}></input>
- <button onClick={() => {onLogin(l,p); history.push('/')}}>Войти</button>
- </div>
- )
- }
- export const CLoginForm = connect (null,{onLogin: actionFullLogin})(LoginForm)
|