1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +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

@@ -353,17 +353,7 @@ class DirentListItem extends React.Component {
});
}
let size = Utils.isHiDPI() ? 48 : 24;
let iconUrl = '';
if (dirent.type === 'file') {
iconUrl = Utils.getFileIconUrl(dirent.name, size);
} else {
let isReadOnly = false;
if (dirent.permission === 'r' || dirent.permission === 'preview') {
isReadOnly = true;
}
iconUrl = Utils.getFolderIconUrl({isReadOnly, size});
}
let iconUrl = Utils.getDirentIcon(dirent);
const {repoEncrypted, isRepoOwner, isAdmin} = this.props;
let showShare = false;