mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-11 11:51:27 +00:00
[shared file view] rewrote with react (#3191)
* rewrote 'file view' with react for audio, document, spreadsheet, svg, unknown files * code improvement for 'video' file * bugfix
This commit is contained in:
25
frontend/src/shared-file-view-unknown.js
Normal file
25
frontend/src/shared-file-view-unknown.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import SharedFileView from './components/shared-file-view/shared-file-view';
|
||||
import SharedFileViewTip from './components/shared-file-view/shared-file-view-tip';
|
||||
|
||||
const { err } = window.shared.pageOptions;
|
||||
|
||||
class SharedFileViewImage extends React.Component {
|
||||
render() {
|
||||
return <SharedFileView content={<FileContent />} />;
|
||||
}
|
||||
}
|
||||
|
||||
class FileContent extends React.Component {
|
||||
render() {
|
||||
if (err) {
|
||||
return <SharedFileViewTip />;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<SharedFileViewImage />,
|
||||
document.getElementById('wrapper')
|
||||
);
|
Reference in New Issue
Block a user