lbry-desktop/ui/modal/modalPasswordUnsave/view.jsx

41 lines
1 KiB
React
Raw Normal View History

2019-08-20 14:29:59 +02:00
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import { deleteSavedPassword } from 'util/saved-passwords';
2019-08-20 14:29:59 +02:00
type Props = {
closeModal: () => void,
callback?: () => void,
2019-08-20 14:29:59 +02:00
};
class ModalPasswordUnsave extends React.PureComponent<Props> {
render() {
return (
<Modal
isOpen
contentLabel={__('Unsave Password')}
2020-08-26 22:28:33 +02:00
title={__('Clear saved password')}
2019-08-20 14:29:59 +02:00
type="confirm"
confirmButtonLabel={__('Forget')}
abortButtonLabel={__('Nevermind')}
2019-08-28 04:35:07 +02:00
onConfirmed={() =>
deleteSavedPassword().then(() => {
2019-08-28 04:35:07 +02:00
this.props.closeModal();
if (this.props.callback) {
this.props.callback();
}
2019-08-28 04:35:07 +02:00
})
2019-08-20 14:29:59 +02:00
}
onAborted={this.props.closeModal}
>
<p>
{__('You are about to delete your saved password.')}{' '}
{__('Your wallet will still be encrypted, but you will have to remember and enter it manually on startup.')}
</p>
</Modal>
);
}
}
export default ModalPasswordUnsave;