Skip to content

Commit

Permalink
Remove lastMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
keerlu committed Nov 8, 2023
1 parent efa00c6 commit 4858ed8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions react/remote-work-demo/src/components/ConversationListItem.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import ConversationImage from "./ConversationImage"

const ConversationListItem = ({conversation, changeConversation, unreadMessages, currentConversation}) => {

const unread = unreadMessages.find(item => item.lastMessage.conversation.id === conversation.id);
const ConversationListItem = ({
conversation,
changeConversation,
unreadMessages,
currentConversation,
}) => {
const unread = unreadMessages.find(
(item) => item.conversation.id === conversation.id
);

return (
<button onClick={() => changeConversation(conversation)} className={`flex flex-row items-center text-gray-400 hover:bg-gray-700 hover:text-white p-2 mx-4 rounded ${currentConversation.id === conversation.id ? 'bg-blue-500 hover:bg-blue-500 !text-white' : ''}`}>
Expand Down

0 comments on commit 4858ed8

Please sign in to comment.