copy changes and a warning

This commit is contained in:
Brent M Clark 2019-10-16 20:25:58 -05:00 committed by Sean Yesmunt
parent 47867efdf0
commit efb1f0d7eb
2 changed files with 20 additions and 10 deletions

View file

@ -18,10 +18,12 @@ type Props = {
};
function ModalRemoveFile(props: Props) {
const { uri, claimIsMine, closeModal, deleteFile, title } = props;
const { uri, claimIsMine, closeModal, deleteFile, title, claim } = props;
const [deleteChecked, setDeleteChecked] = usePersistedState('modal-remove-file:delete', true);
const [abandonChecked, setAbandonChecked] = usePersistedState('modal-remove-file:abandon', true);
console.log({ claim });
return (
<Modal isOpen title="Remove File" contentLabel={__('Confirm File Remove')} type="custom" onAborted={closeModal}>
<section>
@ -32,20 +34,28 @@ function ModalRemoveFile(props: Props) {
<Form onSubmit={() => deleteFile(uri, deleteChecked, claimIsMine ? abandonChecked : false)}>
<FormField
name="file_delete"
label={__('Also delete this file from my computer')}
label={__('Delete this file from my computer')}
type="checkbox"
checked={deleteChecked}
onChange={() => setDeleteChecked(!deleteChecked)}
/>
{claimIsMine && (
<div>
<FormField
name="claim_abandon"
label={__('Abandon the claim for this URI')}
label={`${__('Abandon on blockchain')} (${__('reclaim')} ${claim.amount} ${__('LBC')})`}
type="checkbox"
checked={abandonChecked}
onChange={() => setAbandonChecked(!abandonChecked)}
/>
{abandonChecked === false && (
<p className="error-text">
This file is removed from your publishes area and you can&apos;t remove the deposit from the claim page
anymore
</p>
)}
</div>
)}
<div className="card__actions">
<Button type="submit" button="primary" label={__('OK')} />