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