diff --git a/src/context/intermediate/popovers/UserProfile.tsx b/src/context/intermediate/popovers/UserProfile.tsx index fedaaeb7..ad03a3f4 100644 --- a/src/context/intermediate/popovers/UserProfile.tsx +++ b/src/context/intermediate/popovers/UserProfile.tsx @@ -11,6 +11,7 @@ import { Localizer, Text } from "preact-i18n"; import { useContext, useEffect, useLayoutEffect, useState } from "preact/hooks"; import ChannelIcon from "../../../components/common/ChannelIcon"; +import ServerIcon from "../../../components/common/ServerIcon"; import Tooltip from "../../../components/common/Tooltip"; import UserIcon from "../../../components/common/user/UserIcon"; import { Username } from "../../../components/common/user/UserShort"; @@ -73,6 +74,10 @@ export const UserProfile = observer( channel.recipient_ids!.includes(user_id), ); + const mutualServers = mutual?.servers.map((id) => + client.servers.get(id), + ); + useLayoutEffect(() => { if (!user_id) return; if (typeof profile !== "undefined") setProfile(undefined); @@ -218,6 +223,11 @@ export const UserProfile = observer( onClick={() => setTab("groups")}> +
setTab("servers")}> + +
)} @@ -418,6 +428,32 @@ export const UserProfile = observer( )} )} + {tab === "servers" && ( +
+ {!mutualServers || mutualServers.length === 0 ? ( +
+ +
+ ) : ( + mutualServers.map( + (x) => + x && ( + +
+ + {x.name} +
+ + ), + ) + )} +
+ )} );