diff --git a/src/Avatar.module.css b/src/Avatar.module.css
index 374024d3..516dca12 100644
--- a/src/Avatar.module.css
+++ b/src/Avatar.module.css
@@ -7,6 +7,7 @@
pointer-events: none;
font-weight: 600;
overflow: hidden;
+ flex-shrink: 0;
}
.avatar img {
diff --git a/src/CallList.jsx b/src/CallList.jsx
index fee71d74..63cd8e5b 100644
--- a/src/CallList.jsx
+++ b/src/CallList.jsx
@@ -7,7 +7,7 @@ import { ReactComponent as VideoIcon } from "./icons/Video.svg";
import styles from "./CallList.module.css";
import { getRoomUrl } from "./ConferenceCallManagerHooks";
-export function CallList({ title, rooms }) {
+export function CallList({ title, rooms, client }) {
return (
<>
{title}
@@ -15,6 +15,7 @@ export function CallList({ title, rooms }) {
{rooms.map(({ roomId, roomName, avatarUrl, participants }) => (
@@ -40,7 +41,9 @@ function CallTile({ name, avatarUrl, roomId, participants }) {
{name}
{getRoomUrl(roomId)}
- {participants &&
}
+ {participants && (
+
+ )}
diff --git a/src/ConferenceCallManagerHooks.jsx b/src/ConferenceCallManagerHooks.jsx
index cd7b1d91..51583c23 100644
--- a/src/ConferenceCallManagerHooks.jsx
+++ b/src/ConferenceCallManagerHooks.jsx
@@ -624,7 +624,7 @@ export function getRoomUrl(roomId) {
}
}
-function getAvatarUrl(client, mxcUrl, avatarSize = 96) {
+export function getAvatarUrl(client, mxcUrl, avatarSize = 96) {
const width = Math.floor(avatarSize * window.devicePixelRatio);
const height = Math.floor(avatarSize * window.devicePixelRatio);
return mxcUrl && client.mxcUrlToHttp(mxcUrl, width, height, "crop");
diff --git a/src/Facepile.jsx b/src/Facepile.jsx
index c87fff62..bc084e4d 100644
--- a/src/Facepile.jsx
+++ b/src/Facepile.jsx
@@ -2,23 +2,28 @@ import React from "react";
import styles from "./Facepile.module.css";
import classNames from "classnames";
import { Avatar } from "./Avatar";
+import { getAvatarUrl } from "./ConferenceCallManagerHooks";
-export function Facepile({ className, participants, ...rest }) {
+export function Facepile({ className, client, participants, ...rest }) {
return (
member.name).join(", ")}
{...rest}
>
- {participants.slice(0, 3).map((member, i) => (
-
- ))}
+ {participants.slice(0, 3).map((member, i) => {
+ const avatarUrl = member.user?.avatarUrl;
+ return (
+
+ );
+ })}
{participants.length > 3 && (
{publicRooms.length > 0 && (
-
+
)}
{recentRooms.length > 0 && (
-
+
)}
diff --git a/src/Room.jsx b/src/Room.jsx
index 90b8373e..9fe8ab08 100644
--- a/src/Room.jsx
+++ b/src/Room.jsx
@@ -37,6 +37,7 @@ import { useGroupCall } from "matrix-react-sdk/src/hooks/useGroupCall";
import { useCallFeed } from "matrix-react-sdk/src/hooks/useCallFeed";
import { useMediaStream } from "matrix-react-sdk/src/hooks/useMediaStream";
import {
+ getAvatarUrl,
getRoomUrl,
useClient,
useLoadGroupCall,
@@ -49,6 +50,7 @@ import { OverflowMenu } from "./OverflowMenu";
import { GridLayoutMenu } from "./GridLayoutMenu";
import { UserMenu } from "./UserMenu";
import classNames from "classnames";
+import { Avatar } from "./Avatar";
const canScreenshare = "getDisplayMedia" in navigator.mediaDevices;
// There is currently a bug in Safari our our code with cloning and sending MediaStreams
@@ -445,6 +447,29 @@ function InRoomView({
[layout, setLayout]
);
+ const renderAvatar = useCallback(
+ (roomMember, width, height) => {
+ const avatarUrl = roomMember.user?.avatarUrl;
+ const size = Math.round(Math.min(width, height) / 2);
+
+ return (
+
+ );
+ },
+ [client]
+ );
+
return (
@@ -466,6 +491,7 @@ function InRoomView({
diff --git a/src/Room.module.css b/src/Room.module.css
index 7517bfd3..d6ec2c07 100644
--- a/src/Room.module.css
+++ b/src/Room.module.css
@@ -195,6 +195,13 @@ limitations under the License.
max-width: 360px;
}
+.avatar {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+
@media (min-width: 800px) {
.roomContainer {
flex-direction: row;
diff --git a/src/UserMenu.jsx b/src/UserMenu.jsx
index a79b1425..a6d5d076 100644
--- a/src/UserMenu.jsx
+++ b/src/UserMenu.jsx
@@ -93,7 +93,6 @@ export function UserMenu({ disableLogout }) {
size="sm"
src={avatarUrl}
fallback={(displayName || userName).slice(0, 1).toUpperCase()}
- className={styles.avatar}
/>
) : (