Merge pull request #1167 from vector-im/SimonBrandner/feat/remove-avatar

This commit is contained in:
Šimon Brandner 2023-06-29 18:10:57 +02:00 committed by GitHub
commit 4a90eb341f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 25 deletions

View File

@ -24,9 +24,7 @@ import styles from "./Header.module.css";
import { useModalTriggerState } from "./Modal";
import { Button } from "./button";
import { ReactComponent as Logo } from "./icons/Logo.svg";
import { ReactComponent as VideoIcon } from "./icons/Video.svg";
import { Subtitle } from "./typography/Typography";
import { Avatar, Size } from "./Avatar";
import { IncompatibleVersionModal } from "./IncompatibleVersionModal";
interface HeaderProps extends HTMLAttributes<HTMLElement> {
@ -116,21 +114,11 @@ export function HeaderLogo({ className }: HeaderLogoProps) {
interface RoomHeaderInfo {
roomName: string;
avatarUrl: string | null;
}
export function RoomHeaderInfo({ roomName, avatarUrl }: RoomHeaderInfo) {
export function RoomHeaderInfo({ roomName }: RoomHeaderInfo) {
return (
<>
<div className={styles.roomAvatar}>
<Avatar
size={Size.MD}
src={avatarUrl ?? undefined}
bgKey={roomName}
fallback={roomName.slice(0, 1).toUpperCase()}
/>
<VideoIcon width={16} height={16} />
</div>
<Subtitle data-testid="roomHeader_roomName" fontWeight="semiBold">
{roomName}
</Subtitle>

View File

@ -35,7 +35,6 @@ import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
import { useProfile } from "../profile/useProfile";
import { UserChoices } from "../livekit/useLiveKit";
import { findDeviceByName } from "../media-utils";
import { useRoomAvatar } from "./useRoomAvatar";
declare global {
interface Window {
@ -82,14 +81,12 @@ export function GroupCallView({
}, [groupCall]);
const { displayName, avatarUrl } = useProfile(client);
const roomAvatarUrl = useRoomAvatar(groupCall.room);
const matrixInfo: MatrixInfo = {
displayName,
avatarUrl,
roomName: groupCall.room.name,
roomIdOrAlias,
roomAvatarUrl,
};
useEffect(() => {

View File

@ -395,10 +395,7 @@ export function InCallView({
{!hideHeader && maximisedParticipant === null && (
<Header>
<LeftNav>
<RoomHeaderInfo
roomName={matrixInfo.roomName}
avatarUrl={matrixInfo.roomAvatarUrl}
/>
<RoomHeaderInfo roomName={matrixInfo.roomName} />
<VersionMismatchWarning
users={unencryptedEventsFromUsers}
room={groupCall.room}

View File

@ -55,10 +55,7 @@ export function LobbyView(props: Props) {
{!props.hideHeader && (
<Header>
<LeftNav>
<RoomHeaderInfo
roomName={props.matrixInfo.roomName}
avatarUrl={props.matrixInfo.roomAvatarUrl}
/>
<RoomHeaderInfo roomName={props.matrixInfo.roomName} />
</LeftNav>
<RightNav>
<UserMenuContainer />

View File

@ -35,7 +35,6 @@ export type MatrixInfo = {
avatarUrl: string;
roomName: string;
roomIdOrAlias: string;
roomAvatarUrl: string | null;
};
interface Props {