codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
26 stars 25 forks source link

Create confirmation modal #428

Closed xscottxbrownx closed 10 months ago

xscottxbrownx commented 10 months ago

Creates confirmation modal when need to double-check with user


This PR:

Resolves #316

1. Changes window.confirm (Issue-316) when deleting a document to a modal 2. Replaces LogoutModal, DeleteContactModal, and this "DeleteDocument" with this single reusable modal 3. Adds the useNotification hook to the hooks index for easy importing


The files this PR effects:

Components

ConfirmationModal.jsx Contacts.jsx DeleteContactModal.jsx DocumentTable.jsx DocumentTableRow.jsx LogoutModal.jsx Navbar.jsx Profile.jsx

Tests

DeleteContactModal.test.jsx

Other Files

hooks/index.js modals/index.js


Screenshots (if applicable):

https://github.com/codeforpdx/PASS/assets/71395931/d13ae324-a43e-4e36-bbec-59aed73fc548


Additional Context (optional):

Was going to just create a new modal to delete document (replacing the window.confirm), and realized all these separate modals do the same thing - basically ask the user if they are sure and want to continue with the action.

xscottxbrownx commented 10 months ago

Outside of the minor comment on the JSDoc, the PR changes here works as intended. Think I can approve this.

updated!

xscottxbrownx commented 10 months ago

Got rid of confirmButtonText attribute/prop in ConfirmationModal as it was always the same as the title text.