[GH-ISSUE #291] Improvement: Customer Alert Confirmation Dialog #78

Closed
opened 2026-02-26 18:45:15 +03:00 by kerem · 1 comment
Owner

Originally created by @Hussainzz on GitHub (Aug 22, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/291

Improvement Description

Suggesting a minor improvement. rather than using the normal confirm dialog. we should have some decent-looking Alert dialog confirmation.

<IconButton
  icon={TrashIcon}
  onClick={(event: any) => {
    event.preventDefault();
    event.stopPropagation();
    //We should have something generic that we can reuse across our application
    if (confirm("Are you sure you want to delete this document")) {
      const documentsWithoutIndex = [...documents];
      const removedItem: any = documentsWithoutIndex.splice(index, 1);
      setDocuments(documentsWithoutIndex);
      deleteDocument(document.id)
        .catch((err) => {
          documentsWithoutIndex.splice(index, 0, removedItem);
          setDocuments(documentsWithoutIndex);
        })
        .then(() => {
          loadDocuments();
        });
    }
}}></IconButton>

Proposed Solution

Implementing a generic confirmation using context. I can work on this. if this is assigned to me @Mythie @ElTimuro

Alt Text
Originally created by @Hussainzz on GitHub (Aug 22, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/291 <!--- Please provide a clear and concise title for your improvement suggestion --> ## Improvement Description Suggesting a minor improvement. rather than using the normal confirm dialog. we should have some decent-looking Alert dialog confirmation. ```js <IconButton icon={TrashIcon} onClick={(event: any) => { event.preventDefault(); event.stopPropagation(); //We should have something generic that we can reuse across our application if (confirm("Are you sure you want to delete this document")) { const documentsWithoutIndex = [...documents]; const removedItem: any = documentsWithoutIndex.splice(index, 1); setDocuments(documentsWithoutIndex); deleteDocument(document.id) .catch((err) => { documentsWithoutIndex.splice(index, 0, removedItem); setDocuments(documentsWithoutIndex); }) .then(() => { loadDocuments(); }); } }}></IconButton> ``` ## Proposed Solution Implementing a generic confirmation using context. I can work on this. if this is assigned to me @Mythie @ElTimuro <img src="https://github.com/documenso/documenso/assets/13753141/43f38141-5931-49ae-84e1-331d61a71f74" alt="Alt Text" width="400" height="200">
kerem closed this issue 2026-02-26 18:45:16 +03:00
Author
Owner

@Mythie commented on GitHub (Nov 3, 2023):

Closing as we have integrated custom alerts and dialogs as part of switching to shadcn/ui

<!-- gh-comment-id:1791894957 --> @Mythie commented on GitHub (Nov 3, 2023): Closing as we have integrated custom alerts and dialogs as part of switching to shadcn/ui
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#78
No description provided.