2018-09-12 17:01:48 +08:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Prism from 'prismjs';
|
|
|
|
import Loading from '../../components/loading';
|
2018-09-18 10:11:37 +08:00
|
|
|
import Account from '../../components/account';
|
|
|
|
import Notification from '../../components/notification';
|
2018-09-12 17:01:48 +08:00
|
|
|
import '../../css/initial-style.css';
|
|
|
|
require('@seafile/seafile-editor/src/lib/code-hight-package');
|
|
|
|
|
|
|
|
const contentClass = 'markdown-viewer-render-content';
|
|
|
|
const propTypes = {
|
|
|
|
renderingContent: PropTypes.bool.isRequired,
|
|
|
|
content: PropTypes.string.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
class MainPanel extends React.Component {
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
Prism.highlightAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="main-panel viewer">
|
|
|
|
<div className="main-panel-north">
|
2018-09-18 20:57:17 -05:00
|
|
|
<div className="common-toolbar">
|
2018-09-18 10:11:37 +08:00
|
|
|
<Notification />
|
|
|
|
<Account />
|
|
|
|
</div>
|
2018-09-12 17:01:48 +08:00
|
|
|
</div>
|
|
|
|
<div className="main-panel-center history-viewer-contanier">
|
|
|
|
<div className="content-viewer">
|
|
|
|
{
|
|
|
|
this.props.renderingContent ?
|
|
|
|
(<div className={contentClass + ' article'}><Loading /></div>) :
|
|
|
|
(<div
|
|
|
|
className={contentClass + ' article'}
|
|
|
|
dangerouslySetInnerHTML={{ __html: this.props.content }}
|
|
|
|
/>)
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MainPanel.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default MainPanel;
|