mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
sysadmin reconstruct repo page (#3980)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
|
||||
import { gettext } from '../../utils/constants';
|
||||
|
||||
const propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
message: PropTypes.string.isRequired,
|
||||
confirmBtnText: PropTypes.string,
|
||||
executeOperation: PropTypes.func.isRequired,
|
||||
toggleDialog: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
class CommonOperationConfirmationDialog extends Component {
|
||||
|
||||
toggle = () => {
|
||||
this.props.toggleDialog();
|
||||
}
|
||||
|
||||
executeOperation = () => {
|
||||
this.toggle();
|
||||
this.props.executeOperation();
|
||||
}
|
||||
|
||||
render() {
|
||||
let { title, message, confirmBtnText } = this.props;
|
||||
return (
|
||||
<Modal isOpen={true} toggle={this.toggle}>
|
||||
<ModalHeader toggle={this.toggle}>{title}</ModalHeader>
|
||||
<ModalBody>
|
||||
<p dangerouslySetInnerHTML={{__html: message}}></p>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
|
||||
<Button color="primary" onClick={this.executeOperation}>{confirmBtnText || gettext('Confirm')}</Button>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CommonOperationConfirmationDialog.propTypes = propTypes;
|
||||
|
||||
export default CommonOperationConfirmationDialog;
|
Reference in New Issue
Block a user