Skip to content
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

grouping messages #11

Merged
merged 5 commits into from
Jun 8, 2022
Merged

grouping messages #11

merged 5 commits into from
Jun 8, 2022

Conversation

theonej203
Copy link
Contributor

No description provided.

Copy link
Member

@aerovulpe aerovulpe left a comment

Choose a reason for hiding this comment

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

Good work @theonej203. Just a few issues need to be resolved

import Message from './Message';
import PopupEmojiWindow from './PopupEmojiWindow';
import Reactions from './Reactions';

interface MessageListItemProps {
message: ChatKittyMessage;
avatar: ReactElement;
index?: number;
Copy link
Member

Choose a reason for hiding this comment

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

You can pass the previous message directly. MessageListItem shouldn't know about messages or run presentational logic.


if (index !== undefined && index < messages.length - 1) {
Copy link
Member

Choose a reason for hiding this comment

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

Use the moment library for time operations like comparisons.


for (let i = 0; i < 5; i++) {
if (messageTime[i] !== previousMessageTime[i]) {
console.log(message.id);
Copy link
Member

Choose a reason for hiding this comment

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

Remove this console log

@@ -164,7 +164,11 @@ const ChatAppContextProvider: React.FC<ChatAppContextProviderProps> = ({
const views: Set<View> = new Set();

const demoUsers = [
'910746e1-d6e1-4df1-80b6-88ad90d7d2ad'
'b2a6da08-88bf-4778-b993-7234e6d8a3ff',
Copy link
Member

Choose a reason for hiding this comment

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

👍

@aerovulpe aerovulpe merged commit 1b2d29d into ChatKitty:main Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants