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

optimize code (#4462)

This commit is contained in:
杨顺强
2020-03-02 16:44:39 +08:00
committed by GitHub
parent 35e4b0218f
commit 8e58fb5b07
2 changed files with 14 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import { gettext } from '../../utils/constants';
const propTypes = {
type: PropTypes.oneOf(['move', 'copy']).isRequired,
asyncOperatedFilesLength: PropTypes.number.isRequired,
asyncOperationProgress: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
toggleDialog: PropTypes.func.isRequired,
};
@@ -13,8 +14,9 @@ class CopyMoveDirentProgressDialog extends React.Component {
render() {
let { type , asyncOperationProgress } = this.props;
let title = type === 'move' ? gettext('Move Progress') : gettext('Copy Progress');
let { type , asyncOperationProgress, asyncOperatedFilesLength } = this.props;
let title = type === 'move' ? gettext('Move {files_length} items') : gettext('Copy {files_length} items');
title = title.replace('{files_length}', asyncOperatedFilesLength);
let progressStyle = {
width: asyncOperationProgress + '%',
lineHeight: '40px',