cornellh4i/okb-hope

Finalize the Messages Page

Closed this issue · 0 comments

Your task is to finish implementing the dropdown in the messages page.

When you click the ellipse in the top right corner of the chat, a dropdown opens up.

Psychiatrist side:
Image

Patient side:
Image

  • If a patient clicks "Mark as Unread" in the dropdown, messagesUnreadByPatient should be set to 1. . If a psychiatrist clicks "Mark as Unread" in the dropdown, messagesUnreadByPsych should be set to 1. This is just to mark some message as unread in the conversation (1 is arbitrary). Make sure the conversation moves to the "Unread Messages" section when this is clicked.
  • Create the following modal, so that clicking "Delete Message Thread" in the dropdown should open it up. Use /src/assets/cancel.svg for the cancel button. In frontend/src/assets, create a file called delete.svg. In the OKB Figma, get the SVG code for the delete button and add it to delete.svg.
Screenshot 2024-03-30 at 4 23 26 AM
  • If a patient clicks the "Delete" button in the modal, deletedByPatient should be set to True for the corresponding conversation, and the conversation should be removed from the patient's view but should still be visible on the psychiatrist's end as long as the psychiatrist hasn't deleted the thread.

  • If both deletedByPatient and deletedByPsych are set to True, then we delete the conversation from the Conversations collection, as well as all documents in the Chats collection where the uid and recipientId are the participants of the deleted conversation thread. This ensures you delete the entire message thread properly.