|
@@ -1,20 +1,27 @@
|
|
|
import React from 'react'
|
|
|
import { Field, reduxForm } from 'redux-form'
|
|
|
-import Auth from './index'
|
|
|
+import Authbuttons from './authButtons'
|
|
|
|
|
|
const RegistrForm = props => {
|
|
|
- const { handleSubmit, pristine, reset, submitting } = props
|
|
|
+ const { handleSubmit, pristine, reset, postUsersData } = props
|
|
|
+ const submit = (values) =>{
|
|
|
+ values.avatar = "https://site.com"
|
|
|
+ values.isAdmin = 1
|
|
|
+ values.description = "gfdfgdgdf"
|
|
|
+ postUsersData(values)
|
|
|
+
|
|
|
+}
|
|
|
return (
|
|
|
<div>
|
|
|
- <Auth />
|
|
|
- <form onSubmit={handleSubmit}>
|
|
|
+ <Authbuttons />
|
|
|
+ <form onSubmit={handleSubmit(submit)}>
|
|
|
<div>
|
|
|
<div>
|
|
|
<Field
|
|
|
name="login"
|
|
|
component="input"
|
|
|
type="text"
|
|
|
- placeholder="Login"
|
|
|
+ placeholder="Логин"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -23,16 +30,7 @@ const RegistrForm = props => {
|
|
|
name="password"
|
|
|
component="input"
|
|
|
type="password"
|
|
|
- placeholder="Password"
|
|
|
- />
|
|
|
- </div>
|
|
|
-
|
|
|
- <div>
|
|
|
- <Field
|
|
|
- name="confirmPassword"
|
|
|
- component="input"
|
|
|
- type="password"
|
|
|
- placeholder="Confirm password"
|
|
|
+ placeholder="Пароль"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -41,7 +39,7 @@ const RegistrForm = props => {
|
|
|
name="name"
|
|
|
component="input"
|
|
|
type="text"
|
|
|
- placeholder="Name"
|
|
|
+ placeholder="Имя"
|
|
|
/>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -62,11 +60,11 @@ const RegistrForm = props => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <button type="submit" disabled={pristine || submitting}>
|
|
|
- Submit
|
|
|
+ <button type="submit" disabled={pristine} >
|
|
|
+ Отправить
|
|
|
</button>
|
|
|
- <button type="button" disabled={pristine || submitting} onClick={reset}>
|
|
|
- Clear Values
|
|
|
+ <button type="button" disabled={pristine} onClick={reset}>
|
|
|
+ Очистить поля
|
|
|
</button>
|
|
|
</div>
|
|
|
</form>
|