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:
45
frontend/src/components/file-chooser/repo-list-view.js
Normal file
45
frontend/src/components/file-chooser/repo-list-view.js
Normal 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;
|
Reference in New Issue
Block a user