|
@@ -2,112 +2,32 @@ import React, { Component } from 'react';
|
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// axios.post(
|
|
|
|
-// 'http://127.0.0.1:2000/api/categories',
|
|
|
|
-// {
|
|
|
|
-// "title": "Одежда",
|
|
|
|
-// "description": "Стыдно, когда видно!",
|
|
|
|
-// "parentId": "0"
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// )
|
|
|
|
-
|
|
|
|
-// .then(function (response) { console.log(response) })
|
|
|
|
-// .catch((err)=>console.log(err))
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// axios.post(
|
|
|
|
-// 'http://127.0.0.1:2000/api/staffs',
|
|
|
|
-// {
|
|
|
|
-// "title": "Куртка зимняя",
|
|
|
|
-// "description": "Очень теплая",
|
|
|
|
-// "staff": "Стаф. Не знаю, что вы хотите тут, но я сделал",
|
|
|
|
-// "price": "80000",
|
|
|
|
-// "state": "1",
|
|
|
|
-// "img": "https://militarist.ua/upload/tmp/resize_420_420/ed8006d3e4b83a6643cd16a3247463de.jpg",
|
|
|
|
-// "userId": "1",
|
|
|
|
-// "categoryId": "3"
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// )
|
|
|
|
-
|
|
|
|
-// .then(function (response) { console.log(response) })
|
|
|
|
-// .catch((err)=>console.log(err))
|
|
|
|
-
|
|
|
|
-// axios.post(
|
|
|
|
-// 'http://127.0.0.1:2000/api/categories',
|
|
|
|
-// {
|
|
|
|
-// "title": "Женская",
|
|
|
|
-// "description": "Стыдно, когда видно!",
|
|
|
|
-// "parentId": "1"
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// )
|
|
|
|
-
|
|
|
|
-// .then(function (response) { console.log(response) })
|
|
|
|
-// .catch((err)=>console.log(err))
|
|
|
|
-
|
|
|
|
-// axios.post(
|
|
|
|
-// 'http://127.0.0.1:2000/api/categories',
|
|
|
|
-// {
|
|
|
|
-// "title": "Мужская одежда",
|
|
|
|
-// "description": "Стыдно, когда видно!",
|
|
|
|
-// "parentId": "1"
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// )
|
|
|
|
-
|
|
|
|
-// .then(function (response) { console.log(response) })
|
|
|
|
-// .catch((err)=>console.log(err))
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
class SearchLine extends Component {
|
|
class SearchLine extends Component {
|
|
|
|
|
|
- changeHandler = (e)=>{
|
|
|
|
- const { changeInputValue, searchStaff } = this.props
|
|
|
|
- changeInputValue(e.target.value)
|
|
|
|
- searchStaff(e.target.value)
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- send = () =>{
|
|
|
|
- const { inputData, searchStaff } = this.props
|
|
|
|
- //console.log(this.props)
|
|
|
|
- searchStaff(inputData)
|
|
|
|
|
|
+ changeHandler = e => {
|
|
|
|
+ this.props.changeInputValue(e.target.value)
|
|
|
|
+ this.props.searchStaff(e.target.value)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ send = () => {
|
|
|
|
+ const { inputData, searchStaff } = this.props
|
|
|
|
+ searchStaff(inputData)
|
|
}
|
|
}
|
|
|
|
|
|
- // <div class="search-input">
|
|
|
|
- // <input type="text">
|
|
|
|
- // <span class="highlight"></span>
|
|
|
|
- // <span class="bar"></span>
|
|
|
|
- // <label>Search here</label>
|
|
|
|
- // <span class="glyphicon glyphicon-search"></span>
|
|
|
|
- // <span class="glyphicon glyphicon-remove"></span>
|
|
|
|
- // </div>
|
|
|
|
-
|
|
|
|
render() {
|
|
render() {
|
|
const { inputData } = this.props
|
|
const { inputData } = this.props
|
|
return (
|
|
return (
|
|
-
|
|
|
|
<div className="header__searchLine">
|
|
<div className="header__searchLine">
|
|
<input onChange={this.changeHandler} className="searchInput" placeholder="Что будем покупать?"/>
|
|
<input onChange={this.changeHandler} className="searchInput" placeholder="Что будем покупать?"/>
|
|
<Link to = {`/search/${inputData}`} >
|
|
<Link to = {`/search/${inputData}`} >
|
|
<button onClick={this.send} className="searchBtn" >
|
|
<button onClick={this.send} className="searchBtn" >
|
|
- <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" className="icon">
|
|
|
|
- <rect className="fill-none" width="32" height="32"/>
|
|
|
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" className="icon">
|
|
|
|
+ <rect className="fill-none" width="30" height="30"/>
|
|
<path className="fill-currentcolor" d="M29.82861,24.17139,25.56519,19.908A13.0381,13.0381,0,1,0,19.908,25.56525l4.26343,4.26337a4.00026,4.00026,0,0,0,5.65723-5.65723ZM5,14a9,9,0,1,1,9,9A9.00984,9.00984,0,0,1,5,14Z"/>
|
|
<path className="fill-currentcolor" d="M29.82861,24.17139,25.56519,19.908A13.0381,13.0381,0,1,0,19.908,25.56525l4.26343,4.26337a4.00026,4.00026,0,0,0,5.65723-5.65723ZM5,14a9,9,0,1,1,9,9A9.00984,9.00984,0,0,1,5,14Z"/>
|
|
</svg>
|
|
</svg>
|
|
</button>
|
|
</button>
|
|
</Link>
|
|
</Link>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|