cometchat / cometchat-uikit-react

Ready-to-use Chat UI Components for React (JavaScript/Web)
Other
89 stars 58 forks source link

CometChat Conversation List Item miss the select state #91

Closed zhu-kai closed 4 months ago

zhu-kai commented 2 years ago

Describe the problem

Provide a clear and concise description of the issue

What was the expected behavior?

CometChat Conversation List Item miss the conversation select state

Reproduction

Select a conversation from the conversation list The background color of the selected conversation doesn't change.

Environment

cometchat-pro-react-ui-kit 3.0.2-beta1

The problem is this file: src/components/Chats/CometChatConversationListItem/style.js Using the props.selectedConversation.conversationId to identify the selected conversation. However, the props of <CometChatConversationListItem /> in "src/components/Chats/CometChatConversationList/index.js" doesn't provide selectedConversation.

I added selectedConversation={conversationObj} and fixed this issue.

    const conversationObj = this.filterConversation();
    const conversationList = this.state.conversationlist.map(
      (conversation, key) => {
        return (
          <CometChatConversationListItem
            key={conversation.conversationId}
            conversation={conversation}
            loggedInUser={this.loggedInUser}
            handleClick={this.handleClick}
            actionGenerated={this.actionHandler}
            selectedConversation={conversationObj}
          />
        );
      }
    );
ketanyekale commented 4 months ago

We missed this. Try the latest v4 UI Kits for new features and updates.