Skip to content

Commit

Permalink
fix(#24): verifications icons issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ifaouibadi committed Dec 20, 2023
1 parent 05aa6c1 commit 027fd8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/views/elements/RoomName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?.()
Expand All @@ -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],
Expand Down

0 comments on commit 027fd8f

Please sign in to comment.