You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.0 KiB
43 lines
1.0 KiB
4 years ago
|
import React, { PureComponent } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import Modal, { ModalContent } from '../../modal';
|
||
5 years ago
|
|
||
|
export default class ConfirmDeleteNetwork extends PureComponent {
|
||
|
static propTypes = {
|
||
|
hideModal: PropTypes.func.isRequired,
|
||
|
delRpcTarget: PropTypes.func.isRequired,
|
||
|
onConfirm: PropTypes.func.isRequired,
|
||
|
target: PropTypes.string.isRequired,
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
|
static contextTypes = {
|
||
|
t: PropTypes.func,
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
|
handleDelete = () => {
|
||
4 years ago
|
this.props.delRpcTarget(this.props.target).then(() => {
|
||
4 years ago
|
this.props.onConfirm();
|
||
|
this.props.hideModal();
|
||
|
});
|
||
|
};
|
||
5 years ago
|
|
||
4 years ago
|
render() {
|
||
4 years ago
|
const { t } = this.context;
|
||
5 years ago
|
|
||
|
return (
|
||
|
<Modal
|
||
|
onSubmit={this.handleDelete}
|
||
|
onCancel={() => this.props.hideModal()}
|
||
|
submitText={t('delete')}
|
||
|
cancelText={t('cancel')}
|
||
|
submitType="danger"
|
||
|
>
|
||
|
<ModalContent
|
||
|
title={t('deleteNetwork')}
|
||
|
description={t('deleteNetworkDescription')}
|
||
|
/>
|
||
|
</Modal>
|
||
4 years ago
|
);
|
||
5 years ago
|
}
|
||
|
}
|