mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
optimized code
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { Fragment } from 'react';
|
|||||||
import { gettext, siteRoot } from '../../utils/constants';
|
import { gettext, siteRoot } from '../../utils/constants';
|
||||||
import { Utils } from '../../utils/utils';
|
import { Utils } from '../../utils/utils';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ModalPortal from '../modal-portal';
|
||||||
import ListTagDialog from '../dialog/list-tag-dialog';
|
import ListTagDialog from '../dialog/list-tag-dialog';
|
||||||
import CreateTagDialog from '../dialog/create-tag-dialog';
|
import CreateTagDialog from '../dialog/create-tag-dialog';
|
||||||
import UpdateTagDialog from '../dialog/update-tag-dialog';
|
import UpdateTagDialog from '../dialog/update-tag-dialog';
|
||||||
@@ -73,8 +74,8 @@ class DirTool extends React.Component {
|
|||||||
<li className="toolbar-item"><a className="op-link sf2-icon-trash" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a></li>
|
<li className="toolbar-item"><a className="op-link sf2-icon-trash" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a></li>
|
||||||
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>
|
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
{
|
{this.state.isListRepoTagShow && (
|
||||||
this.state.isListRepoTagShow &&
|
<ModalPortal>
|
||||||
<ListTagDialog
|
<ListTagDialog
|
||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
onListTagCancel={this.onListRepoTagToggle}
|
onListTagCancel={this.onListRepoTagToggle}
|
||||||
@@ -82,30 +83,34 @@ class DirTool extends React.Component {
|
|||||||
onUpdateRepoTag={this.onUpdateRepoTagToggle}
|
onUpdateRepoTag={this.onUpdateRepoTagToggle}
|
||||||
onListTaggedFiles={this.onListTaggedFileToggle}
|
onListTaggedFiles={this.onListTaggedFileToggle}
|
||||||
/>
|
/>
|
||||||
}
|
</ModalPortal>
|
||||||
{
|
)}
|
||||||
this.state.isCreateRepoTagShow &&
|
{this.state.isCreateRepoTagShow && (
|
||||||
|
<ModalPortal>
|
||||||
<CreateTagDialog
|
<CreateTagDialog
|
||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
toggleCancel={this.onCreateRepoTagToggle}
|
toggleCancel={this.onCreateRepoTagToggle}
|
||||||
/>
|
/>
|
||||||
}
|
</ModalPortal>
|
||||||
{
|
)}
|
||||||
this.state.isUpdateRepoTagShow &&
|
{this.state.isUpdateRepoTagShow && (
|
||||||
|
<ModalPortal>
|
||||||
<UpdateTagDialog
|
<UpdateTagDialog
|
||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
currentTag={this.state.currentTag}
|
currentTag={this.state.currentTag}
|
||||||
toggleCancel={this.onUpdateRepoTagToggle}
|
toggleCancel={this.onUpdateRepoTagToggle}
|
||||||
/>
|
/>
|
||||||
}
|
</ModalPortal>
|
||||||
{
|
)}
|
||||||
this.state.isListTaggedFileShow &&
|
{this.state.isListTaggedFileShow && (
|
||||||
|
<ModalPortal>
|
||||||
<ListTaggedFilesDialog
|
<ListTaggedFilesDialog
|
||||||
repoID={this.props.repoID}
|
repoID={this.props.repoID}
|
||||||
currentTag={this.state.currentTag}
|
currentTag={this.state.currentTag}
|
||||||
toggleCancel={this.onListTaggedFileToggle}
|
toggleCancel={this.onListTaggedFileToggle}
|
||||||
/>
|
/>
|
||||||
}
|
</ModalPortal>
|
||||||
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
} else if (!isFile && permission) {
|
} else if (!isFile && permission) {
|
||||||
|
Reference in New Issue
Block a user