8000 Stopped using reload for edit and delete messages and using state, and finished replying to messages by nicholascheww · Pull Request #41 · MakanMatch/Frontend · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Stopped using reload for edit and delete messages and using state, and finished replying to messages #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 11, 2024

Conversation

nicholascheww
Copy link
Contributor

What was done since the last PR:

  • Timestamp is not used anymore
  • Changed edit message to be using state instead of reloading the page
  • Use Modal instead of prompt for the edit message
  • Display (edited) after a message has been edited
  • Changed delete message to be using state instead of reloading the page
  • Done reply message where its a different chat bubble and displays the message that they are replying to
  • Reply message fixed with the replying to ... to be on top of the input text along with a Cross button to cancel the reply
  • Adjusted the images in ChatBubble to be more aligned with the Cheveron to look more nice
  • Added showed date to split messages based on the date of the message that was sent
  • When a new message is sent the screen will scroll down automatically
  • Removed unnecessary console.log messages

@nicholascheww nicholascheww added the enhancement New feature or request label Jul 8, 2024
@nicholascheww nicholascheww requested a review from Prakhar896 July 8, 2024 09:49
Copy link
Contributor
@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few more things to change. Following PR review on Backend, you may have to change your sender references here to real user IDs; do take note.

};
ws.current.send(JSON.stringify(editedMessage));
setMessages((prevMessages) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the server not send an edit message event, triggering the edit event handling code on lines 75-82?

return new Date(date).toLocaleDateString(undefined, options);
};

const shouldDisplayDate = (currentMessage, previousMessage) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-implemented logic here.

@nicholascheww nicholascheww requested a review from Prakhar896 July 9, 2024 13:56
Copy link
Contributor
@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Prakhar896 Prakhar896 merged commit b283366 into main Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0