Changed Audio/Video preview to just display a file info when encountering a file that cannot be played
Этот коммит содержится в:
31
web/react/components/file_info_preview.jsx
Обычный файл
31
web/react/components/file_info_preview.jsx
Обычный файл
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import * as Utils from '../utils/utils.jsx';
|
||||
|
||||
export default function FileInfoPreview({filename, fileUrl, fileInfo}) {
|
||||
// non-image files include a section providing details about the file
|
||||
let infoString = 'File type ' + fileInfo.extension.toUpperCase();
|
||||
if (fileInfo.size > 0) {
|
||||
infoString += ', Size ' + Utils.fileSizeToString(fileInfo.size);
|
||||
}
|
||||
|
||||
const name = decodeURIComponent(Utils.getFileName(filename));
|
||||
|
||||
return (
|
||||
<div className='file-details__container'>
|
||||
<a
|
||||
className={'file-details__preview'}
|
||||
href={fileUrl}
|
||||
target='_blank'
|
||||
>
|
||||
<span className='file-details__preview-helper' />
|
||||
<img src={Utils.getPreviewImagePath(filename)}/>
|
||||
</a>
|
||||
<div className='file-details'>
|
||||
<div className='file-details__name'>{name}</div>
|
||||
<div className='file-details__info'>{infoString}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Ссылка в новой задаче
Block a user