1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 06:11:16 +00:00

select files and right dir tools is show (#6581)

This commit is contained in:
Michael An
2024-08-20 11:20:30 +08:00
committed by GitHub
parent 9051ad836e
commit a4caf6e970
3 changed files with 99 additions and 93 deletions

View File

@@ -1,9 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Utils } from '../../utils/utils';
import SortOptionsDialog from '../../components/dialog/sort-options';
import DirPath from './dir-path';
import DirTool from './dir-tool';
const propTypes = {
currentRepoInfo: PropTypes.object.isRequired,
@@ -15,17 +13,12 @@ const propTypes = {
onTabNavClick: PropTypes.func,
pathPrefix: PropTypes.array,
isViewFile: PropTypes.bool,
updateUsedRepoTags: PropTypes.func.isRequired,
fileTags: PropTypes.array.isRequired,
onDeleteRepoTag: PropTypes.func.isRequired,
toggleTreePanel: PropTypes.func.isRequired,
direntList: PropTypes.array,
sortBy: PropTypes.string,
sortOrder: PropTypes.string,
sortItems: PropTypes.func,
currentMode: PropTypes.string.isRequired,
switchViewMode: PropTypes.func.isRequired,
isCustomPermission: PropTypes.bool,
repoEncrypted: PropTypes.bool.isRequired,
isGroupOwnedRepo: PropTypes.bool.isRequired,
enableDirPrivateShare: PropTypes.bool.isRequired,
@@ -38,7 +31,6 @@ const propTypes = {
filePermission: PropTypes.string,
repoTags: PropTypes.array.isRequired,
onFileTagChanged: PropTypes.func.isRequired,
viewId: PropTypes.string,
onItemMove: PropTypes.func.isRequired,
};
@@ -58,7 +50,6 @@ class CurDirPath extends React.Component {
};
render() {
const isDesktop = Utils.isDesktop();
return (
<div className="cur-dir-path d-flex justify-content-between align-items-center">
<DirPath
@@ -87,23 +78,7 @@ class CurDirPath extends React.Component {
repoTags={this.props.repoTags}
onItemMove={this.props.onItemMove}
/>
{isDesktop &&
<DirTool
repoID={this.props.repoID}
repoName={this.props.repoName}
userPerm={this.props.userPerm}
currentPath={this.props.currentPath}
updateUsedRepoTags={this.props.updateUsedRepoTags}
onDeleteRepoTag={this.props.onDeleteRepoTag}
currentMode={this.props.currentMode}
switchViewMode={this.props.switchViewMode}
isCustomPermission={this.props.isCustomPermission}
sortBy={this.props.sortBy}
sortOrder={this.props.sortOrder}
sortItems={this.props.sortItems}
viewId={this.props.viewId}
/>}
{!isDesktop && this.props.direntList.length > 0 &&
{!this.props.isDesktop && this.props.direntList.length > 0 &&
<span className="sf3-font sf3-font-sort action-icon" onClick={this.toggleSortOptionsDialog}></span>}
{this.state.isSortOptionsDialogOpen &&
<SortOptionsDialog