mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-18 09:12:55 +00:00
* react react-dom reach-router react-image-lightbox * update seafile-editor version * optimize codemirror code * optimize code * repair code bug * optimize code * optimize code * optimize seafile-editor version * update seafile-editor version * optimize code * optimize code
31 lines
878 B
JavaScript
31 lines
878 B
JavaScript
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';
|
|
import SeafileCodeMirror from './components/seafile-codemirror';
|
|
import './css/text-file-view.css';
|
|
|
|
const { err, fileExt, fileContent } = window.shared.pageOptions;
|
|
|
|
class FileContent extends React.Component {
|
|
render() {
|
|
if (err) {
|
|
return <SharedFileViewTip />;
|
|
}
|
|
|
|
return (
|
|
<div className="shared-file-view-body text-file-view">
|
|
<SeafileCodeMirror fileExt={fileExt} value={fileContent} />
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
class SharedFileViewText extends React.Component {
|
|
render() {
|
|
return <SharedFileView content={<FileContent />} />;
|
|
}
|
|
}
|
|
|
|
ReactDom.render(<SharedFileViewText />, document.getElementById('wrapper'));
|