mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 11:27:18 +00:00
Add sdoc viewer (#5867)
* add seafile sdoc viewer * optimize code * optimize code * update sdoc-editor version * optimize code
This commit is contained in:
@@ -8,6 +8,7 @@ import { Utils } from '../../utils/utils';
|
||||
import Search from '../../components/search/search';
|
||||
import Notification from '../../components/common/notification';
|
||||
import Account from '../../components/common/account';
|
||||
import SdocWikiPageViewer from '../../components/sdoc-wiki-page-viewer';
|
||||
|
||||
const propTypes = {
|
||||
path: PropTypes.string.isRequired,
|
||||
@@ -120,7 +121,7 @@ class MainPanel extends Component {
|
||||
<div className={`cur-view-content ${isViewingFile ? 'o-hidden' : ''}`}>
|
||||
{!this.props.pathExist && errMessage}
|
||||
{this.props.pathExist && this.props.isDataLoading && <Loading />}
|
||||
{isViewingFile && (
|
||||
{isViewingFile && Utils.isMarkdownFile(this.props.path) && (
|
||||
<SeafileMarkdownViewer
|
||||
isWiki={true}
|
||||
path={this.props.path}
|
||||
@@ -132,6 +133,18 @@ class MainPanel extends Component {
|
||||
onLinkClick={this.props.onLinkClick}
|
||||
/>
|
||||
)}
|
||||
{isViewingFile && Utils.isSdocFile(this.props.path) && (
|
||||
<SdocWikiPageViewer
|
||||
isWiki={true}
|
||||
path={this.props.path}
|
||||
repoID={repoID}
|
||||
markdownContent={this.props.content}
|
||||
isFileLoading={this.props.isDataLoading}
|
||||
lastModified = {this.props.lastModified}
|
||||
latestContributor={this.props.latestContributor}
|
||||
onLinkClick={this.props.onLinkClick}
|
||||
/>
|
||||
)}
|
||||
{(!this.props.isDataLoading && !this.props.isViewFile) && (
|
||||
<WikiDirListView
|
||||
path={this.props.path}
|
||||
|
Reference in New Issue
Block a user