copy changes and a warning
This commit is contained in:
parent
47867efdf0
commit
efb1f0d7eb
2 changed files with 20 additions and 10 deletions
|
@ -18,10 +18,12 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function ModalRemoveFile(props: 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 [deleteChecked, setDeleteChecked] = usePersistedState('modal-remove-file:delete', true);
|
||||||
const [abandonChecked, setAbandonChecked] = usePersistedState('modal-remove-file:abandon', true);
|
const [abandonChecked, setAbandonChecked] = usePersistedState('modal-remove-file:abandon', true);
|
||||||
|
|
||||||
|
console.log({ claim });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal isOpen title="Remove File" contentLabel={__('Confirm File Remove')} type="custom" onAborted={closeModal}>
|
<Modal isOpen title="Remove File" contentLabel={__('Confirm File Remove')} type="custom" onAborted={closeModal}>
|
||||||
<section>
|
<section>
|
||||||
|
@ -32,20 +34,28 @@ function ModalRemoveFile(props: Props) {
|
||||||
<Form onSubmit={() => deleteFile(uri, deleteChecked, claimIsMine ? abandonChecked : false)}>
|
<Form onSubmit={() => deleteFile(uri, deleteChecked, claimIsMine ? abandonChecked : false)}>
|
||||||
<FormField
|
<FormField
|
||||||
name="file_delete"
|
name="file_delete"
|
||||||
label={__('Also delete this file from my computer')}
|
label={__('Delete this file from my computer')}
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={deleteChecked}
|
checked={deleteChecked}
|
||||||
onChange={() => setDeleteChecked(!deleteChecked)}
|
onChange={() => setDeleteChecked(!deleteChecked)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{claimIsMine && (
|
{claimIsMine && (
|
||||||
<FormField
|
<div>
|
||||||
name="claim_abandon"
|
<FormField
|
||||||
label={__('Abandon the claim for this URI')}
|
name="claim_abandon"
|
||||||
type="checkbox"
|
label={`${__('Abandon on blockchain')} (${__('reclaim')} ${claim.amount} ${__('LBC')})`}
|
||||||
checked={abandonChecked}
|
type="checkbox"
|
||||||
onChange={() => setAbandonChecked(!abandonChecked)}
|
checked={abandonChecked}
|
||||||
/>
|
onChange={() => setAbandonChecked(!abandonChecked)}
|
||||||
|
/>
|
||||||
|
{abandonChecked === false && (
|
||||||
|
<p className="error-text">
|
||||||
|
This file is removed from your publishes area and you can't remove the deposit from the claim page
|
||||||
|
anymore
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="card__actions">
|
<div className="card__actions">
|
||||||
<Button type="submit" button="primary" label={__('OK')} />
|
<Button type="submit" button="primary" label={__('OK')} />
|
||||||
|
|
|
@ -831,4 +831,4 @@
|
||||||
"An email address is required to sync your account.": "An email address is required to sync your account.",
|
"An email address is required to sync your account.": "An email address is required to sync your account.",
|
||||||
"Sign Out": "Sign Out",
|
"Sign Out": "Sign Out",
|
||||||
"Follow more tags": "Follow more tags"
|
"Follow more tags": "Follow more tags"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue