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 ...@@ -127,11 +127,13 @@ export function GroupMemberSidebar({ channel, ctx }: Props & { channel: Channels
} }
export function ServerMemberSidebar({ channel, ctx }: Props & { channel: Channels.TextChannel }) { export function ServerMemberSidebar({ channel, ctx }: Props & { channel: Channels.TextChannel }) {
const { openScreen } = useIntermediate();
const [members, setMembers] = useState<Servers.Member[] | undefined>(undefined); 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 users = useUsers(members?.map(x => x._id.user) ?? []).filter(x => typeof x !== 'undefined', ctx) as Users.User[];
const status = useContext(StatusContext); const status = useContext(StatusContext);
const client = useContext(AppContext); const client = useContext(AppContext);
useEffect(() => { useEffect(() => {
if (status === ClientStatus.ONLINE && typeof members === 'undefined') { if (status === ClientStatus.ONLINE && typeof members === 'undefined') {
client.servers.members.fetchMembers(channel.server) client.servers.members.fetchMembers(channel.server)
...@@ -196,6 +198,7 @@ export function ServerMemberSidebar({ channel, ctx }: Props & { channel: Channel ...@@ -196,6 +198,7 @@ export function ServerMemberSidebar({ channel, ctx }: Props & { channel: Channel
key={user._id} key={user._id}
user={user} user={user}
context={channel} context={channel}
onClick={() => openScreen({ id: 'profile', user_id: user._id })}
/> />
// </LinkProfile> // </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