|
@@ -2,16 +2,21 @@ import React from 'react'
|
|
import { Field, reduxForm } from 'redux-form'
|
|
import { Field, reduxForm } from 'redux-form'
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+const massive = [{
|
|
|
|
+ title: "Инструменты",
|
|
|
|
+ value : 1
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ title: "Техника",
|
|
|
|
+ value : 2
|
|
|
|
+}]
|
|
|
|
|
|
const SendingForm = props => {
|
|
const SendingForm = props => {
|
|
const { handleSubmit, pristine, reset, submitting, AddNewStaff } = props
|
|
const { handleSubmit, pristine, reset, submitting, AddNewStaff } = props
|
|
const submit = values => {
|
|
const submit = values => {
|
|
values.img = "http://site.com"
|
|
values.img = "http://site.com"
|
|
values.staff = "Машина"
|
|
values.staff = "Машина"
|
|
- values.state = 1
|
|
|
|
values.userId = 1
|
|
values.userId = 1
|
|
- values.categoryId = 1
|
|
|
|
AddNewStaff(values)
|
|
AddNewStaff(values)
|
|
|
|
|
|
};
|
|
};
|
|
@@ -25,6 +30,7 @@ const SendingForm = props => {
|
|
component="input"
|
|
component="input"
|
|
type="text"
|
|
type="text"
|
|
placeholder="Название"
|
|
placeholder="Название"
|
|
|
|
+ className="input"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -33,12 +39,30 @@ const SendingForm = props => {
|
|
<div>
|
|
<div>
|
|
<Field
|
|
<Field
|
|
name="description"
|
|
name="description"
|
|
- component="input"
|
|
|
|
|
|
+ component="textarea"
|
|
type="text"
|
|
type="text"
|
|
placeholder="Описание"
|
|
placeholder="Описание"
|
|
|
|
+ className="input"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div>
|
|
|
|
+
|
|
|
|
+ <div >
|
|
|
|
+ <label ><Field name="state" component = "input" type="radio" value="0" className="radio"/> Новое</label>
|
|
|
|
+ <label><Field name="state" component = "input" type="radio" value="1"/> б/у</label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <label>Favorite Color</label>
|
|
|
|
+ <div>
|
|
|
|
+ <Field name="categoryId" component = "select" className="button">
|
|
|
|
+ {massive.map((el,key)=> (<option key={key} value={el.value}>{el.title}</option>))}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </Field>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div>
|
|
<div>
|
|
<div>
|
|
<div>
|
|
<Field
|
|
<Field
|
|
@@ -46,14 +70,15 @@ const SendingForm = props => {
|
|
component="input"
|
|
component="input"
|
|
type="number"
|
|
type="number"
|
|
placeholder="Цена"
|
|
placeholder="Цена"
|
|
|
|
+ className="input"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- <button type="submit" disabled={pristine || submitting}>
|
|
|
|
|
|
+ <button type="submit" disabled={pristine || submitting} className="button">
|
|
Submit
|
|
Submit
|
|
</button>
|
|
</button>
|
|
- <button type="button" disabled={pristine || submitting} onClick={reset}>
|
|
|
|
|
|
+ <button type="button" disabled={pristine || submitting} onClick={reset} className="button">
|
|
Clear Values
|
|
Clear Values
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|