Components - Makleido/ChatTestingApp GitHub Wiki

Components i worked with


Component Purpose
Message Show message boxes in chat
Contacts Show Users you can chat with in the users list

Message component

Name Method/Variable Purpose
openOptions const-useState-boolean Its for checking the state of a messages options menu if its visible or not
editMessage const-useState-boolean its for checking if the editing pane is open or not
messageToUpdate const-useState-string Its for the updated message, that we will send to backend to change
token const-any(on purpose, but gets string) JWT token from localStorage
optionsMenu method Changes the state of openOptions, and show/hide the menu
openEditingContainer method Changes the state of editMessage, and show/hide the editing pane
deleteOption method Its for deleting a message, if ones deleted then the front shows a deleted message text
editMessageOption method It does send the edited message to backend
editedMessage method Shows if a message we want to show was edited or not
onEnterPress method Sends the edited message from textarea on pressing ENTER
update method updates the value of messageToUpdate

Back home
Home