Skip to content

[FE-22] Build ConfirmationModal component #519

@mftee

Description

@mftee

Problem

Destructive actions such as deleting a document, revoking a verification, or removing a user have no confirmation step. Users can accidentally trigger irreversible actions without any warning.

Proposed Solution

Create a reusable ConfirmationModal component inside frontend/module/components/confirmation-modal/ that wraps any destructive action behind a modal confirmation dialog.

Acceptance Criteria

  • Accepts title, message, confirmLabel (default Delete), cancelLabel (default Cancel), onConfirm, onCancel, and isOpen props
  • Renders a modal overlay that traps focus while open
  • Confirm button has a red (danger) styling to communicate the destructive nature of the action
  • Calls onConfirm when the confirm button is clicked, onCancel when the cancel button or overlay background is clicked
  • Supports an isLoading prop that shows a spinner on the confirm button and disables both buttons while an async action is in progress
  • Closes when the Escape key is pressed
  • Manages focus correctly — focus moves into the modal on open and returns to the trigger element on close
  • All component files live inside frontend/module/components/confirmation-modal/

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions