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