1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

optimized getIcon interface (#2904)

* optimized getIcon interface

* optimzied get lib-icon code

* repair share-repo bug
This commit is contained in:
杨顺强
2019-01-29 15:22:02 +08:00
committed by Daniel Pan
parent 6b24da7fda
commit 8a16b4013d
17 changed files with 88 additions and 196 deletions

View File

@@ -182,22 +182,9 @@ class Item extends Component {
}
const data = this.props.data;
const permission = data.permission;
let is_readonly = false;
if (permission == 'r' || permission == 'preview') {
is_readonly = true;
}
data.icon_url = Utils.getLibIconUrl({
is_encrypted: data.encrypted,
is_readonly: is_readonly,
size: Utils.isHiDPI() ? 48 : 24
});
data.icon_title = Utils.getLibIconTitle({
'encrypted': data.encrypted,
'is_admin': data.is_admin,
'permission': permission
});
data.icon_url = Utils.getLibIconUrl(data);
data.icon_title = Utils.getLibIconTitle(data);
data.url = `${siteRoot}#shared-libs/lib/${data.repo_id}/`;
let iconVisibility = this.state.showOpIcon ? '' : ' invisible';