Skip to content
Snippets Groups Projects
Verified Commit 692a26bd authored by bree's avatar bree
Browse files

Link to profiles from server sidebar

parent b100d06c
No related merge requests found
......@@ -127,11 +127,13 @@ export function GroupMemberSidebar({ channel, ctx }: Props & { channel: Channels
}
export function ServerMemberSidebar({ channel, ctx }: Props & { channel: Channels.TextChannel }) {
const { openScreen } = useIntermediate();
const [members, setMembers] = useState<Servers.Member[] | undefined>(undefined);
const users = useUsers(members?.map(x => x._id.user) ?? []).filter(x => typeof x !== 'undefined', ctx) as Users.User[];
const status = useContext(StatusContext);
const client = useContext(AppContext);
useEffect(() => {
if (status === ClientStatus.ONLINE && typeof members === 'undefined') {
client.servers.members.fetchMembers(channel.server)
......@@ -196,6 +198,7 @@ export function ServerMemberSidebar({ channel, ctx }: Props & { channel: Channel
key={user._id}
user={user}
context={channel}
onClick={() => openScreen({ id: 'profile', user_id: user._id })}
/>
// </LinkProfile>
)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment