fix(#24): verifications icons issues (#25)

pull/27073/head
Badi Ifaoui 2023-12-20 12:53:39 +01:00 committed by GitHub
parent 05aa6c1dfb
commit 793977203b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -34,6 +34,9 @@ export const RoomName = ({ room, children, maxLength }: IProps): JSX.Element =>
const { isTokenGatedRoom, isCommunityRoom } = useVerifiedRoom(room);
const roomUsers: string[] = useMemo(() => {
if ((room as Room).getJoinedMemberCount?.() > 2 || (room as IPublicRoomsChunkRoom).num_joined_members > 2) {
return [];
}
return (
(room as Room)
?.getMembers?.()
@ -55,7 +58,9 @@ export const RoomName = ({ room, children, maxLength }: IProps): JSX.Element =>
{isCommunityRoom && <CommunityRoomIcon className="sh_RoomTokenGatedRoomIcon" />}
{isTokenGatedRoom && <TokenGatedRoomIcon className="sh_RoomTokenGatedRoomIcon" />}
<span dir="auto">{truncatedRoomName}</span>
{roomUsers?.length && <UserVerifiedBadge userId={roomUsers[0]} />}
{roomUsers?.length && !isTokenGatedRoom && !isCommunityRoom && (
<UserVerifiedBadge userId={roomUsers[0]} />
)}
</span>
),
[truncatedRoomName, isCommunityRoom, isTokenGatedRoom, roomUsers],