Display room avatars

This commit is contained in:
Robin Townsend
2022-05-18 19:00:59 -04:00
parent 183eea9f24
commit 24f721e414
12 changed files with 112 additions and 63 deletions

View File

@@ -33,7 +33,6 @@ import { useMediaHandler } from "../settings/useMediaHandler";
import { usePTT } from "./usePTT";
import { Timer } from "./Timer";
import { Toggle } from "../input/Toggle";
import { getAvatarUrl } from "../matrix-utils";
import { ReactComponent as AudioIcon } from "../icons/Audio.svg";
import { usePTTSounds } from "../sound/usePttSounds";
import { PTTClips } from "../sound/PTTClips";
@@ -79,6 +78,7 @@ interface Props {
client: MatrixClient;
roomId: string;
roomName: string;
avatarUrl: string;
groupCall: GroupCall;
participants: RoomMember[];
userMediaFeeds: CallFeed[];
@@ -91,6 +91,7 @@ export const PTTCallView: React.FC<Props> = ({
client,
roomId,
roomName,
avatarUrl,
groupCall,
participants,
userMediaFeeds,
@@ -105,7 +106,6 @@ export const PTTCallView: React.FC<Props> = ({
const [containerRef, bounds] = useMeasure({ polyfill: ResizeObserver });
const facepileSize = bounds.width < 800 ? "sm" : "md";
const pttButtonSize = 232;
const pttBorderWidth = 6;
const { audioOutput } = useMediaHandler();
@@ -135,13 +135,7 @@ export const PTTCallView: React.FC<Props> = ({
const activeSpeakerUser = activeSpeakerUserId
? client.getUser(activeSpeakerUserId)
: null;
const activeSpeakerAvatarUrl = activeSpeakerUser
? getAvatarUrl(
client,
activeSpeakerUser.avatarUrl,
pttButtonSize - pttBorderWidth * 2
)
: null;
const activeSpeakerAvatarUrl = activeSpeakerUser?.avatarUrl;
const activeSpeakerDisplayName = activeSpeakerUser
? activeSpeakerUser.displayName
: "";
@@ -156,7 +150,11 @@ export const PTTCallView: React.FC<Props> = ({
/>
<Header className={styles.header}>
<LeftNav>
<RoomSetupHeaderInfo roomName={roomName} onPress={onLeave} />
<RoomSetupHeaderInfo
roomName={roomName}
avatarUrl={avatarUrl}
onPress={onLeave}
/>
</LeftNav>
<RightNav />
</Header>