forked from Gitlink/forgeplus-react
22 lines
770 B
JavaScript
22 lines
770 B
JavaScript
import React, { useState } from "react";
|
||
import { Input} from "antd";
|
||
import './Component.scss';
|
||
|
||
export default ({history}) => {
|
||
const [searchValue, setSearchValue] = useState("");
|
||
|
||
function onGlobalSearch(e) {
|
||
window.location.href = `/search?value=${e.target.value}`;
|
||
}
|
||
return (
|
||
<React.Fragment>
|
||
<div className="headSerach aboutSubTitle" onBlur={()=>{setTimeout(() => {
|
||
setSearchValue("");
|
||
}, 500)}}>
|
||
<i className = "iconfont icon-bianzu11 font-15" onClick={()=>onGlobalSearch({target:{value:searchValue}})}></i>
|
||
<Input placeholder="请输入搜索关键字" onPressEnter={onGlobalSearch} onChange={(value)=>setSearchValue(value.target.value)} value={searchValue}></Input>
|
||
</div>
|
||
</React.Fragment>
|
||
)
|
||
};
|