1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 09:51:26 +00:00

[image file view] rewrote it with react (#2983)

* [image file view] rewrote it with react

* [image file view] modification

* [image file view] modified code indentation & etc.
This commit is contained in:
llj
2019-02-22 18:16:44 +08:00
committed by Daniel Pan
parent 834dd3723c
commit 2a2bd2b783
13 changed files with 536 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
import React from 'react';
import { gettext } from '../../utils/constants';
const { err } = window.app.pageOptions;
class FileViewTip extends React.Component {
render() {
let errorMsg;
if (err == 'File preview unsupported') {
errorMsg = <p>{gettext('Online view is not applicable to this file format')}</p>;
} else {
errorMsg = <p className="error">{err}</p>;
}
return (
<div className="file-view-content flex-1">
<div className="file-view-tip">
{errorMsg}
<a href="?dl=1" className="btn btn-secondary">{gettext('Download')}</a>
</div>
</div>
);
}
}
export default FileViewTip;