1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00
Files
seahub/frontend/src/components/dialog/upload-remind-dialog.js
杨顺强 4080144bca Translate improve (#2679)
* modify translate

* modify translate
2018-12-20 15:37:14 +08:00

43 lines
1.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
const propTypes = {
currentResumableFile: PropTypes.object.isRequired,
replaceRepetitionFile: PropTypes.func.isRequired,
uploadFile: PropTypes.func.isRequired,
cancelFileUpload: PropTypes.func.isRequired,
};
class UploadRemindDialog extends React.Component {
toggle = () => {
this.props.cancelFileUpload();
}
render() {
let title = gettext('Replace file {filename}?');
title = title.replace('{filename}', '<span class="a-simaulte">' + this.props.currentResumableFile.fileName + '</span>');
return (
<Modal isOpen={true} toggle={this.toggle}>
<ModalHeader toggle={this.toggle} ><div dangerouslySetInnerHTML={{__html: title}}></div></ModalHeader>
<ModalBody>
<p>{gettext('A file with the same name already exists in this folder.')}</p>
<p>{gettext('Replacing it will overwrite its content.')}</p>
</ModalBody>
<ModalFooter>
<Button outline color="primary" onClick={this.props.replaceRepetitionFile}>{gettext('Replace')}</Button>
<Button outline color="info" onClick={this.props.uploadFile}>{gettext("Don't replace")}</Button>
<Button outline color="danger" onClick={this.toggle}>{gettext('Cancel')}</Button>
</ModalFooter>
</Modal>
);
}
}
UploadRemindDialog.propTypes = propTypes;
export default UploadRemindDialog;