-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this 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
src/fragments/MessageListItem.tsx
Outdated
import Message from './Message'; | ||
import PopupEmojiWindow from './PopupEmojiWindow'; | ||
import Reactions from './Reactions'; | ||
|
||
interface MessageListItemProps { | ||
message: ChatKittyMessage; | ||
avatar: ReactElement; | ||
index?: number; |
There was a problem hiding this comment.
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.
src/fragments/MessageListItem.tsx
Outdated
|
||
if (index !== undefined && index < messages.length - 1) { |
There was a problem hiding this comment.
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.
src/fragments/MessageListItem.tsx
Outdated
|
||
for (let i = 0; i < 5; i++) { | ||
if (messageTime[i] !== previousMessageTime[i]) { | ||
console.log(message.id); |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.