Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This feature introduces a reusable and customizable alert modal component, enhancing user interactions with consistent and visually appealing confirmation dialogs. It allows developers to easily invoke modals for confirmation and alert purposes without duplicating code, improving maintainability and user experience.
Key Changes
Added React Modal Library
react-modal
version3.16.1
for modal functionality.Alert Modal Component
AlertModal.js
to display a customizable modal dialog.Alert Modal Context
AlertModalContext.js
to manage modal states using React Context API.showModal
andhideModal
functions for ease of use.Integrated Context in Application
AlertModalProvider
inApp.js
for global modal access.Styling
AlertModal.css
for consistent modal styling across the application.Updated Dependencies
package.json
andpackage-lock.json
to include the new library.How to Use
useAlertModal
fromAlertModalContext.js
in any component.showModal
with the required parameters to display the modal.Example Usage