Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance file remove modal #3069

Merged
merged 3 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions src/ui/modal/modalRemoveFile/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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);

Expand All @@ -32,20 +32,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 && (
<FormField
name="claim_abandon"
label={__('Abandon the claim for this URI')}
type="checkbox"
checked={abandonChecked}
onChange={() => setAbandonChecked(!abandonChecked)}
/>
<div>
<FormField
name="claim_abandon"
label={__('Abandon on blockchain (reclaim %amount% LBC)', { amount: claim.amount })}
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')} />
Expand Down
2 changes: 1 addition & 1 deletion static/app-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -831,4 +831,4 @@
"An email address is required to sync your account.": "An email address is required to sync your account.",
"Sign Out": "Sign Out",
"Follow more tags": "Follow more tags"
}
}