mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 08:28:11 +00:00
optimized getIcon interface (#2904)
* optimized getIcon interface * optimzied get lib-icon code * repair share-repo bug
This commit is contained in:
@@ -34,18 +34,7 @@ class WikiDirListItem extends React.Component {
|
||||
render() {
|
||||
let { path, dirent } = this.props;
|
||||
let href = siteRoot + 'wikis' + Utils.joinPath(path, dirent.name);
|
||||
|
||||
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);
|
||||
|
||||
return (
|
||||
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
|
||||
|
Reference in New Issue
Block a user