Closed sksmagr23 closed 1 week ago
@sksmagr23 is attempting to deploy a commit to the Shivansh Bhatanagar's projects Team on Vercel.
A member of the Team first needs to authorize it.
So i should clarify the message sending structure. When the Chatbox mounts, it registers a handler in channel.ts for chat events. (similar to how we subscribe to game events, see GameContext) When the user sends a message, we don't immediately append the message to the message array, rather we update the array when the server sends the MESSAGE_SENT
event. (For better UX, we should display the message as sent even before the server sends a response, but that will be handled later)
Finally we should store messages in a JS object (or better, the Map class) instead of array, so that we can find them in constant time. so we store (messageid, messageobject) as the key value pair in the object.
@kuv2707 done the review changes, you can have a look if any other change required
@sksmagr23 It is a good practice to respond to the feedback (even with a reaction) instead of resolving the conversation yourself
You can add some drop shadow to the chat box
Added the drop shadow to chatbox
@kuv2707 done all the reviewed changes and resolved the previous unresolved reviews
The lint errors are coming because I have removed api call in messageinput and event listeners in chatbox.tsx as function created are not used, Once they are implemented further, it will be fixed
We can merge it at this point, and address the regressions as a follow-up Thanks for all the work @sksmagr23 !
Description
Added a collapsible chat box in the gamepage, which contains messagelist, input box, reactions to messages. The necessary files are added in a folder Chatbox in src/library. The folder include files namely 1.types.ts 2.chatbox.tsx 3.Message.tsx 4.MessageInput.tsx 5.MessageList.tsx
The packages emoji picker react and react icons are also installed.
fixes #125
How to Test
Related Issues
125
Checklist
Screenshots