mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 18:30:53 +00:00
fix image review (#3284)
This commit is contained in:
@@ -6,6 +6,7 @@ import Dirent from '../../models/dirent';
|
|||||||
import DetailListView from './detail-list-view';
|
import DetailListView from './detail-list-view';
|
||||||
import FileTag from '../../models/file-tag';
|
import FileTag from '../../models/file-tag';
|
||||||
import '../../css/dirent-detail.css';
|
import '../../css/dirent-detail.css';
|
||||||
|
import { siteRoot } from '../../utils/constants';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
repoID: PropTypes.string.isRequired,
|
repoID: PropTypes.string.isRequired,
|
||||||
@@ -119,8 +120,7 @@ class DirentDetail extends React.Component {
|
|||||||
let bigIconUrl = dirent ? Utils.getDirentIcon(dirent, true) : Utils.getDirentIcon(folderDirent, true);
|
let bigIconUrl = dirent ? Utils.getDirentIcon(dirent, true) : Utils.getDirentIcon(folderDirent, true);
|
||||||
const isImg = dirent ? Utils.imageCheck(dirent.name) : Utils.imageCheck(folderDirent.name);
|
const isImg = dirent ? Utils.imageCheck(dirent.name) : Utils.imageCheck(folderDirent.name);
|
||||||
if (isImg) {
|
if (isImg) {
|
||||||
bigIconUrl = '/' + dirent.encoded_thumbnail_src;
|
bigIconUrl = siteRoot + 'thumbnail/' + this.props.repoID + '/1024/' + dirent.name;
|
||||||
smallIconUrl = '/' + dirent.encoded_thumbnail_src;
|
|
||||||
}
|
}
|
||||||
let direntName = dirent ? dirent.name : folderDirent.name;
|
let direntName = dirent ? dirent.name : folderDirent.name;
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ class DirentDetail extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className="detail-body dirent-info">
|
<div className="detail-body dirent-info">
|
||||||
<div className="img">
|
<div className="img">
|
||||||
<img src={bigIconUrl} width="96" alt="" />
|
<img src={bigIconUrl} className="thumbnail" alt="" />
|
||||||
</div>
|
</div>
|
||||||
{this.state.direntDetail &&
|
{this.state.direntDetail &&
|
||||||
<div className="dirent-table-container">
|
<div className="dirent-table-container">
|
||||||
|
@@ -59,6 +59,12 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dirent-info .img .thumbnail {
|
||||||
|
max-width: calc(100% - 4px);
|
||||||
|
max-height: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.dirent-table-container {
|
.dirent-table-container {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Reference in New Issue
Block a user