forgeplus-react/src/forums/Component/ListSearch.jsx

23 lines
831 B
JavaScript

import React from 'react';
import { Input } from 'antd';
import { Greenback } from '../css/layout';
import { Link } from 'react-router-dom';
const Search = Input.Search;
export default (({ onSearch , current_user })=>{
return(
<React.Fragment>
<Search onSearch={onSearch} placeholder="搜索" allowClear/>
{
current_user && current_user.login ?
<Link className="greenbtn" to={`/forums/new`} style={{width:"100%",marginTop:"20px"}}>
<i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>
</Link>
:
<a className="greenbtn" href={"/login"} style={{width:"100%",marginTop:"20px"}}>
<i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>
</a>
}
</React.Fragment>
)
})