Upgrade the FE so currentUser able to actually delete comment or reply and persist the changes on the database/server.
FE now includes handleDelete() which will call the DELETE api
handleDelete() is handled within CommentCard and ReplyCard, and not inside the Modal component. Modal is made a singleton component - abstract enough to be used for different purpose.
Add <Spinner /> in Modal to manage the state of loading while deletion in progress.
Modal will disable the Cancel and Yes, Delete (confirm) buttons while deletion in progress.
Issue related:
Description
Upgrade the FE so currentUser able to actually delete comment or reply and persist the changes on the database/server.
handleDelete()
which will call the DELETE apihandleDelete()
is handled within CommentCard and ReplyCard, and not inside the Modal component. Modal is made a singleton component - abstract enough to be used for different purpose.<Spinner />
in Modal to manage the state of loading while deletion in progress.Cancel
andYes, Delete
(confirm) buttons while deletion in progress.Testing Result
Test passed ✅
https://user-images.githubusercontent.com/31334333/191957512-dd49d7cd-0378-4f49-9292-d4ac2f82f291.mov