1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +00:00
Files
seahub/frontend/src/components/dialog/remove-webdav-password.js
Michael An 08abceb14b custom modal header close icon (#7240)
* seahub custom modal header

* add custom modal header

* special modal use custom close
2024-12-24 11:20:40 +08:00

50 lines
1.3 KiB
JavaScript

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Modal, ModalBody, ModalFooter, Button } from 'reactstrap';
import SeahubModalHeader from '@/components/common/seahub-modal-header';
import { gettext } from '../../utils/constants';
const propTypes = {
removePassword: PropTypes.func.isRequired,
toggle: PropTypes.func.isRequired
};
class RemoveWebdavPassword extends Component {
constructor(props) {
super(props);
this.state = {
btnDisabled: false
};
}
submit = () => {
this.setState({
btnDisabled: true
});
this.props.removePassword();
};
render() {
const { toggle } = this.props;
return (
<Modal centered={true} isOpen={true} toggle={toggle}>
<SeahubModalHeader toggle={toggle}>{gettext('Delete WebDAV Password')}</SeahubModalHeader>
<ModalBody>
<p>{gettext('Are you sure you want to delete WebDAV password?')}</p>
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={toggle}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.submit} disabled={this.state.btnDisabled}>{gettext('Delete')}</Button>
</ModalFooter>
</Modal>
);
}
}
RemoveWebdavPassword.propTypes = propTypes;
export default RemoveWebdavPassword;