mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-16 15:19:06 +00:00
optimized getIcon interface (#2904)
* optimized getIcon interface * optimzied get lib-icon code * repair share-repo bug
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { siteRoot } from '../../utils/constants';
|
||||
import { Utils } from '../../utils/utils';
|
||||
|
||||
const propTypes = {
|
||||
@@ -17,8 +16,7 @@ class SearchResultItem extends React.Component {
|
||||
|
||||
render() {
|
||||
let item = this.props.item;
|
||||
let fileIconSize = Utils.isHiDPI() ? 48 : 24;
|
||||
let fileIconUrl = item.is_dir ? siteRoot + 'media/img/folder-192.png' : Utils.getFileIconUrl(item.name, fileIconSize);
|
||||
let fileIconUrl = item.is_dir ? Utils.getFolderIconUrl(false, 192) : Utils.getFileIconUrl(item.name, 192);
|
||||
return (
|
||||
<li className="search-result-item" onClick={this.onClickHandler}>
|
||||
<img className="item-img" src={fileIconUrl} alt="" />
|
||||
|
Reference in New Issue
Block a user