-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
improvement: add confirmation before deleting item #787
improvement: add confirmation before deleting item #787
Conversation
a50cac9
to
3b39327
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I've left some small comments and then it'll be good to go!
<ActionButton | ||
loading={pendingDeletion} | ||
loading={isPendingDelete} | ||
className="size-14 rounded-full bg-background" | ||
variant="none" | ||
onClick={() => { | ||
deleteBookmark({ bookmarkId: bookmark.id }); | ||
}} | ||
onClick={() => setDeleteBookmarkDialogOpen(true)} | ||
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this button no longer itself takes an action, we should switch it to just a normal button instead of ActionButton
. That way, you also won't need to propagate the pending state back to this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<DeleteBookmarkConfirmationDialog | ||
bookmark={bookmark} | ||
open={deleteBookmarkDialogOpen} | ||
setOpen={setDeleteBookmarkDialogOpen} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably should be moved out of the dropdown menu. Maybe move it beside the other modals on line 108?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open={open} | ||
setOpen={setOpen} | ||
title={`Delete ${bookmark.title ?? "Bookmark"}?`} | ||
description={`Are you sure you want to delete this bookmark?`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this to the translation files in apps/web/lib/i18n/locales/en.json
? So that people can also get a chance to translate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added it in add delete bookmark confirmation dialog
52924c6
to
571c730
Compare
571c730
to
5460f44
Compare
Thank you and congrats on the first contribution in Hoarder! |
PR for #776
For mobile,
added an alert when deleting bookmark
For web,
added an confirmation dialog when deleting bookmark
Proof:
https://drive.google.com/drive/folders/1067NHRKKIoip3vZRfgaJnbxBj1XHf5oc?usp=sharing