1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

repair icon style (#3255)

This commit is contained in:
王健辉
2019-04-12 14:27:19 +08:00
committed by Daniel Pan
parent e7ebfcf66c
commit e760a25cf4
2 changed files with 8 additions and 2 deletions

View File

@@ -16,11 +16,12 @@ class SearchResultItem extends React.Component {
render() { render() {
let item = this.props.item; let item = this.props.item;
let folderIconUrl = item.link_content ? Utils.getFolderIconUrl(false, 192) : Utils.getDefaultLibIconUrl(false); let className = item.link_content ? "item-img" : "lib-item-img";
let folderIconUrl = item.link_content ? Utils.getFolderIconUrl(false, 192) : Utils.getDefaultLibIconUrl(true);
let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name, 192); let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name, 192);
return ( return (
<li className="search-result-item" onClick={this.onClickHandler}> <li className="search-result-item" onClick={this.onClickHandler}>
<img className="item-img" src={fileIconUrl} alt="" /> <img className={className} src={fileIconUrl} alt="" />
<div className="item-content"> <div className="item-content">
<div className="item-name ellipsis">{item.name}</div> <div className="item-name ellipsis">{item.name}</div>
<div className="item-link ellipsis">{item.repo_name}/{item.link_content}</div> <div className="item-link ellipsis">{item.repo_name}/{item.link_content}</div>

View File

@@ -67,6 +67,11 @@
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.search-result-item .lib-item-img {
width: 36px;
height: 36px;
padding: 4px;
}
.search-result-item .item-content { .search-result-item .item-content {
flex: 1; flex: 1;
width: 0; width: 0;