diff --git a/packages/desktop/src/tree/FooterControls.tsx b/packages/desktop/src/tree/FooterControls.tsx index d5f6a4f..fe80640 100644 --- a/packages/desktop/src/tree/FooterControls.tsx +++ b/packages/desktop/src/tree/FooterControls.tsx @@ -32,8 +32,8 @@ import { } from 'react-icons/fi'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { ConversationUserMember } from '@nirvana/core/models/conversation.model'; import { MasterConversation } from '../util/types'; -import { MdOutlineRecordVoiceOver } from 'react-icons/md'; import { SUPPORT_DISPLAY_NAME } from '../util/support'; import { blueGrey } from '@mui/material/colors'; import useAuth from '../providers/AuthProvider'; @@ -165,7 +165,7 @@ export default function FooterControls() { aria-expanded={open ? 'true' : undefined} > {userLocalStream ? ( - + ) : ( )} @@ -277,24 +277,16 @@ function OverlayConversation({ }} max={3} > - {masterConversation.members?.map((conversationUser, index) => { - return ( - (conversationUser._id.toString() !== user._id.toString() || isSelected) && ( - - ) - ); - })} + {masterConversation.members?.map((conversationUserMember, index) => ( + + ))} {isSelected && ( @@ -339,6 +331,54 @@ function OverlayConversation({ ); } +function OverlayConversationAvatar({ + conversationUserMember, + isTunedIn, + isConversationSelected, +}: { + conversationUserMember: ConversationUserMember; + isTunedIn: boolean; + isConversationSelected: boolean; // if user is connecting or just have this conversation selected +}) { + const { userLocalStream } = useConversations(); + const { user } = useAuth(); + + const localVideoRef = useRef(null); + + useEffect(() => { + if (localVideoRef?.current && userLocalStream) { + localVideoRef.current.srcObject = userLocalStream; + } + }, [localVideoRef, userLocalStream]); + + if (conversationUserMember._id.toString() === user._id.toString() && userLocalStream) { + return ( + + ); + } + + return ( + (conversationUserMember._id.toString() !== user._id.toString() || isConversationSelected) && ( + + ) + ); + return <>; +} + const NO_DEVICE_SELECTION = 'NA'; function UserSettingsDialog({ open, handleClose }: { handleClose: () => void; open: boolean }) {