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

avatarUrl not working for conversation list. #69

Open
nomanshahzad opened this issue Nov 7, 2024 · 1 comment
Open

avatarUrl not working for conversation list. #69

nomanshahzad opened this issue Nov 7, 2024 · 1 comment

Comments

@nomanshahzad
Copy link

I am trying to display the profile photo as the avatar for each contact in the conversation list. However, when I set the avatarUrl prop for the conversation list, it doesn’t seem to work, and the value appears as undefined.
Could anyone suggest any alternative solutions or workarounds for this?

Below are my code snippets:

import React, { useState, useEffect } from 'react';
import { UIKitProvider, Chat, ConversationList, useClient, rootStore, ConversationItem, Avatar } from 'agora-chat-uikit';
import 'agora-chat-uikit/style.css';
const appKey = '611181437#1368525';


for (const contact of contacts) {
            const name = contactsAttributes[contact].nickname
            rootStore.conversationStore.addConversation({
              chatType: "singleChat",
              conversationId: contact,
              name,
              avatarUrl: "https://picsum.photos/200/300",
              lastMessage: {},
              unreadCount: ""
            });
          }
          
<div className="flex w-full" style={{ height: 'calc(100vh - 196px)' }}>
      <div className="border-r" style={{ width: '500px' }}>
        <ConversationList />
      </div>

      <div className="flex-1">
        <Chat />
      </div>
    </div>
    
@myZhangDong
Copy link
Contributor

getUserInfo(userIds).then(usersInfo => {
//usersInfo: {[userId]: {avatarurl: '', nickname: '', userId: ''}}
rootStore.addressStore.setAppUserInfo(usersInfo);
});
You can set the avatar and nickname using method setAppUserInfo

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

No branches or pull requests

2 participants