1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 17:02:47 +00:00

Implement wiki mode menu function (#2461)

This commit is contained in:
山水人家
2018-10-25 13:36:06 +08:00
committed by Daniel Pan
parent 91cbfc508e
commit f3e0284751
39 changed files with 1995 additions and 610 deletions

View File

@@ -0,0 +1,45 @@
import React from 'react';
import PropTypes from 'prop-types';
import RepoListItem from './repo-list-item';
const propTypes = {
repo: PropTypes.object,
repoList: PropTypes.array,
selectedRepo: PropTypes.object,
initToShowChildren: PropTypes.bool.isRequired,
selectedPath: PropTypes.string,
onDirentItemClick: PropTypes.func.isRequired,
onRepoItemClick: PropTypes.func.isRequired,
};
class RepoListView extends React.Component {
render() {
let { repo, repoList } = this.props;
if (repo) {
repoList = [];
repoList.push(repo);
}
return (
<ul className="list-view-content file-chooser-item">
{repoList.length > 0 && repoList.map((repoItem, index) => {
return (
<RepoListItem
key={index}
repo={repoItem}
initToShowChildren={this.props.initToShowChildren}
selectedRepo={this.props.selectedRepo}
selectedPath={this.props.selectedPath}
onRepoItemClick={this.props.onRepoItemClick}
onDirentItemClick={this.props.onDirentItemClick}
/>
);
})}
</ul>
);
}
}
RepoListView.propTypes = propTypes;
export default RepoListView;