mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 02:10:24 +00:00
[dirent list] show different file icons (#2786)
This commit is contained in:
@@ -408,6 +408,10 @@ class DirentListItem extends React.Component {
|
|||||||
tagTitle += item.name + ' ';
|
tagTitle += item.name + ' ';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileIconSize = Utils.isHiDPI() ? 48 : 24;
|
||||||
|
const fileIconUrl = dirent.type == 'file' ? Utils.getFileIconUrl(dirent.name, fileIconSize) : '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave}>
|
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave}>
|
||||||
@@ -420,8 +424,8 @@ class DirentListItem extends React.Component {
|
|||||||
</td>
|
</td>
|
||||||
<td className="text-center">
|
<td className="text-center">
|
||||||
<div className="dir-icon">
|
<div className="dir-icon">
|
||||||
<img src={dirent.type === 'dir' ? siteRoot + 'media/img/folder-192.png' : siteRoot + 'media/img/file/192/txt.png'} alt=''></img>
|
<img src={dirent.type === 'dir' ? siteRoot + 'media/img/folder-192.png' : fileIconUrl} alt='' />
|
||||||
{dirent.is_locked && <img className="locked" src={siteRoot + 'media/img/file-locked-32.png'} alt={gettext('locked')}></img>}
|
{dirent.is_locked && <img className="locked" src={siteRoot + 'media/img/file-locked-32.png'} alt={gettext('locked')} />}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="name">
|
<td className="name">
|
||||||
|
Reference in New Issue
Block a user