Replace the avatar stack in the header with an icon
This is a design update.
This commit is contained in:
@@ -20,7 +20,7 @@ import { MatrixClient } from "matrix-js-sdk/src/client";
|
||||
import { Room, isE2EESupported } from "livekit-client";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
|
||||
import { JoinRule, RoomMember } from "matrix-js-sdk/src/matrix";
|
||||
import { JoinRule } from "matrix-js-sdk/src/matrix";
|
||||
import { Heading, Link, Text } from "@vector-im/compound-web";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -111,18 +111,11 @@ export function GroupCallView({
|
||||
client,
|
||||
]);
|
||||
|
||||
const participatingMembers = useMemo(() => {
|
||||
const members: RoomMember[] = [];
|
||||
// Count each member only once, regardless of how many devices they use
|
||||
const addedUserIds = new Set<string>();
|
||||
for (const membership of memberships) {
|
||||
if (!addedUserIds.has(membership.member.userId)) {
|
||||
addedUserIds.add(membership.member.userId);
|
||||
members.push(membership.member);
|
||||
}
|
||||
}
|
||||
return members;
|
||||
}, [memberships]);
|
||||
// Count each member only once, regardless of how many devices they use
|
||||
const participantCount = useMemo(
|
||||
() => new Set<string>(memberships.map((m) => m.member.userId)).size,
|
||||
[memberships]
|
||||
);
|
||||
|
||||
const deviceContext = useMediaDevices();
|
||||
const latestDevices = useRef<MediaDevices>();
|
||||
@@ -340,7 +333,7 @@ export function GroupCallView({
|
||||
client={client}
|
||||
matrixInfo={matrixInfo}
|
||||
rtcSession={rtcSession}
|
||||
participatingMembers={participatingMembers}
|
||||
participantCount={participantCount}
|
||||
onLeave={onLeave}
|
||||
hideHeader={hideHeader}
|
||||
muteStates={muteStates}
|
||||
@@ -391,7 +384,7 @@ export function GroupCallView({
|
||||
onEnter={() => enterRTCSession(rtcSession)}
|
||||
confineToRoom={confineToRoom}
|
||||
hideHeader={hideHeader}
|
||||
participatingMembers={participatingMembers}
|
||||
participantCount={participantCount}
|
||||
onShareClick={onShareClick}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -120,7 +120,7 @@ export interface InCallViewProps {
|
||||
rtcSession: MatrixRTCSession;
|
||||
livekitRoom: Room;
|
||||
muteStates: MuteStates;
|
||||
participatingMembers: RoomMember[];
|
||||
participantCount: number;
|
||||
onLeave: (error?: Error) => void;
|
||||
hideHeader: boolean;
|
||||
otelGroupCallMembership?: OTelGroupCallMembership;
|
||||
@@ -134,7 +134,7 @@ export function InCallView({
|
||||
rtcSession,
|
||||
livekitRoom,
|
||||
muteStates,
|
||||
participatingMembers,
|
||||
participantCount,
|
||||
onLeave,
|
||||
hideHeader,
|
||||
otelGroupCallMembership,
|
||||
@@ -411,8 +411,7 @@ export function InCallView({
|
||||
name={matrixInfo.roomName}
|
||||
avatarUrl={matrixInfo.roomAvatar}
|
||||
encrypted={matrixInfo.roomEncrypted}
|
||||
participants={participatingMembers}
|
||||
client={client}
|
||||
participantCount={participantCount}
|
||||
/>
|
||||
</LeftNav>
|
||||
<RightNav>
|
||||
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { FC, useCallback, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix";
|
||||
import { MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
import { Button, Link } from "@vector-im/compound-web";
|
||||
import classNames from "classnames";
|
||||
import { useHistory } from "react-router-dom";
|
||||
@@ -44,7 +44,7 @@ interface Props {
|
||||
onEnter: () => void;
|
||||
confineToRoom: boolean;
|
||||
hideHeader: boolean;
|
||||
participatingMembers: RoomMember[];
|
||||
participantCount: number;
|
||||
onShareClick: (() => void) | null;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export const LobbyView: FC<Props> = ({
|
||||
onEnter,
|
||||
confineToRoom,
|
||||
hideHeader,
|
||||
participatingMembers,
|
||||
participantCount,
|
||||
onShareClick,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -104,8 +104,7 @@ export const LobbyView: FC<Props> = ({
|
||||
name={matrixInfo.roomName}
|
||||
avatarUrl={matrixInfo.roomAvatar}
|
||||
encrypted={matrixInfo.roomEncrypted}
|
||||
participants={participatingMembers}
|
||||
client={client}
|
||||
participantCount={participantCount}
|
||||
/>
|
||||
</LeftNav>
|
||||
<RightNav>
|
||||
|
||||
Reference in New Issue
Block a user