mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 03:18:23 +00:00
Repair eslint wraning (#2453)
This commit is contained in:
@@ -18,12 +18,17 @@ const propTypes = {
|
||||
filePath: PropTypes.string.isRequired,
|
||||
isFileLoading: PropTypes.bool.isRequired,
|
||||
isViewFileState: PropTypes.bool.isRequired,
|
||||
changedNode: PropTypes.object,
|
||||
onMenuClick: PropTypes.func.isRequired,
|
||||
onSearchedClick: PropTypes.func.isRequired,
|
||||
onMainNavBarClick: PropTypes.func.isRequired,
|
||||
onLinkClick: PropTypes.func.isRequired,
|
||||
onMainItemClick: PropTypes.func.isRequired,
|
||||
onMainItemDelete: PropTypes.func.isRequired,
|
||||
}
|
||||
onMainAddFile: PropTypes.func.isRequired,
|
||||
onMainAddFolder: PropTypes.func.isRequired,
|
||||
switchViewMode: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class MainPanel extends Component {
|
||||
|
||||
@@ -215,10 +220,10 @@ class MainPanel extends Component {
|
||||
{
|
||||
this.state.newMenuShow &&
|
||||
<ul className="menu dropdown-menu" style={this.state.operationMenuStyle}>
|
||||
<li className="dropdown-item" onClick={this.addFolder}>{gettext('New Folder')}</li>
|
||||
<li className="dropdown-item" onClick={this.addFile}>{gettext('New File')}</li>
|
||||
<li className="dropdown-item menu-inner-divider"></li>
|
||||
<li className="dropdown-item" onClick={this.addMarkdownFile}>{gettext('New Markdown File')}</li>
|
||||
<li className="dropdown-item" onClick={this.addFolder}>{gettext('New Folder')}</li>
|
||||
<li className="dropdown-item" onClick={this.addFile}>{gettext('New File')}</li>
|
||||
<li className="dropdown-item menu-inner-divider"></li>
|
||||
<li className="dropdown-item" onClick={this.addMarkdownFile}>{gettext('New Markdown File')}</li>
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
@@ -235,8 +240,7 @@ class MainPanel extends Component {
|
||||
<div className="path-containter">
|
||||
<a href={siteRoot + '#common/'} className="normal">{gettext('Libraries')}</a>
|
||||
<span className="path-split">/</span>
|
||||
{
|
||||
this.props.filePath === '/' ?
|
||||
{this.props.filePath === '/' ?
|
||||
<span>{slug}</span> :
|
||||
<a className="path-link" data-path="/" onClick={this.onMainNavBarClick}>{slug}</a>
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext, siteRoot, logoPath, mediaUrl, siteTitle, logoWidth, logoHeight } from '../../utils/constants';
|
||||
import TreeView from '../../components/tree-view/tree-view';
|
||||
import NodeMenu from '../../components/tree-view/node-menu';
|
||||
@@ -8,6 +9,20 @@ import Rename from '../../components/dialog/rename-dialog';
|
||||
import CreateFolder from '../../components/dialog/create-folder-dialog';
|
||||
import CreateFile from '../../components/dialog/create-file-dialog';
|
||||
|
||||
const propTypes = {
|
||||
changedNode: PropTypes.object,
|
||||
treeData: PropTypes.object.isRequired,
|
||||
currentFilePath: PropTypes.string.isRequired,
|
||||
closeSideBar: PropTypes.bool.isRequired,
|
||||
onCloseSide: PropTypes.func.isRequired,
|
||||
onDirCollapse: PropTypes.func.isRequired,
|
||||
onNodeClick: PropTypes.func.isRequired,
|
||||
onRenameNode: PropTypes.func.isRequired,
|
||||
onDeleteNode: PropTypes.func.isRequired,
|
||||
onAddFileNode: PropTypes.func.isRequired,
|
||||
onAddFolderNode: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class SidePanel extends Component {
|
||||
|
||||
constructor(props) {
|
||||
@@ -239,4 +254,7 @@ class SidePanel extends Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SidePanel.propTypes = propTypes;
|
||||
|
||||
export default SidePanel;
|
||||
|
Reference in New Issue
Block a user