未登录点击弹出登录框

This commit is contained in:
caishi 2021-05-11 15:26:27 +08:00
parent e38508ea59
commit 6d9af5c906
3 changed files with 5 additions and 5 deletions

View File

@ -1,10 +1,9 @@
import React from 'react'; import React from 'react';
import { Input } from 'antd'; import { Input } from 'antd';
import { Greenback } from '../css/layout';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
const Search = Input.Search; const Search = Input.Search;
export default (({ onSearch , current_user })=>{ export default (({ onSearch , current_user , showLoginDialog })=>{
return( return(
<React.Fragment> <React.Fragment>
<Search onSearch={onSearch} placeholder="搜索" allowClear/> <Search onSearch={onSearch} placeholder="搜索" allowClear/>
@ -14,7 +13,7 @@ export default (({ onSearch , current_user })=>{
<i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>写点什么 <i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>写点什么
</Link> </Link>
: :
<a className="greenbtn" href={"/login"} style={{width:"100%",marginTop:"20px"}}> <a className="greenbtn" onClick={showLoginDialog} style={{width:"100%",marginTop:"20px"}}>
<i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>写点什么 <i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>写点什么
</a> </a>
} }

View File

@ -155,7 +155,7 @@ function aa(props) {
<Gap> <Gap>
<WhiteBack style={{ marginBottom: "15px" }}> <WhiteBack style={{ marginBottom: "15px" }}>
<div style={{ padding: "20px" }}> <div style={{ padding: "20px" }}>
<ListSearch onSearch={onSearch} current_user={current_user} /> <ListSearch onSearch={onSearch} current_user={current_user} showLoginDialog={props && props.showLoginDialog}/>
</div> </div>
<div style={{ padding: "0px 20px", borderTop: "1px solid #eee" }}> <div style={{ padding: "0px 20px", borderTop: "1px solid #eee" }}>
<UrlItem user={current_user} /> <UrlItem user={current_user} />

View File

@ -28,6 +28,7 @@ function theme(props) {
let plateMainId = props.match.params.plateMainId; let plateMainId = props.match.params.plateMainId;
let current_user = props.current_user; let current_user = props.current_user;
// console.log("111",props);
// 获取列表 // 获取列表
useEffect(() => { useEffect(() => {
if (plateMainId) { if (plateMainId) {
@ -145,7 +146,7 @@ function theme(props) {
<Short> <Short>
<Gap> <Gap>
<WhiteBack style={{ padding: "20px" }}> <WhiteBack style={{ padding: "20px" }}>
<ListSearch onSearch={onSearch} current_user={current_user}/> <ListSearch onSearch={onSearch} current_user={current_user} showLoginDialog={props && props.showLoginDialog}/>
</WhiteBack> </WhiteBack>
<ThemeRight operation={operation} plateId={plateMainId}/> <ThemeRight operation={operation} plateId={plateMainId}/>
</Gap> </Gap>