import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import UploadListItem from './upload-list-item';
import ForbidUploadListItem from './forbid-upload-list-item';
const propTypes = {
uploadBitrate: PropTypes.number.isRequired,
totalProgress: PropTypes.number.isRequired,
retryFileList: PropTypes.array.isRequired,
uploadFileList: PropTypes.array.isRequired,
forbidUploadFileList: PropTypes.array.isRequired,
onCloseUploadDialog: PropTypes.func.isRequired,
onCancelAllUploading: PropTypes.func.isRequired,
onUploadCancel: PropTypes.func.isRequired,
onUploadRetry: PropTypes.func.isRequired,
onUploadRetryAll: PropTypes.func.isRequired,
allFilesUploaded: PropTypes.bool.isRequired,
};
class UploadProgressDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
isMinimized: false
};
}
onCancelAllUploading = () => {
this.props.onCancelAllUploading();
}
onMinimizeUpload = (e) => {
e.nativeEvent.stopImmediatePropagation();
this.setState({isMinimized: !this.state.isMinimized});
}
onCloseUpload = (e) => {
e.nativeEvent.stopImmediatePropagation();
this.props.onCloseUploadDialog();
}
render() {
let uploadBitrate = Utils.formatBitRate(this.props.uploadBitrate);
let uploadedMessage = gettext('File Upload');
let uploadingMessage = gettext('File Uploading...') + ' ' + this.props.totalProgress + '% (' + uploadBitrate + ')';
let uploadingOptions = ();
let uploadedOptions = (
{gettext('name')} | {gettext('size')} | {gettext('progress')} | {gettext('state')} |
---|