MutualGroupDMs: fix DM sidebar (again)

This commit is contained in:
Vendicated 2025-04-30 03:30:37 +02:00
parent 096f848385
commit b954bf3c9d
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -32,8 +32,8 @@ const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel");
const UserUtils = findByPropsLazy("getGlobalName"); const UserUtils = findByPropsLazy("getGlobalName");
const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds"); const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds");
const MutualsListClasses = findByPropsLazy("row", "icon", "name", "nick");
const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"', ".header"); const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"', ".header");
const GuildLabelClasses = findByPropsLazy("guildNick", "guildAvatarWithoutIcon");
function getGroupDMName(channel: Channel) { function getGroupDMName(channel: Channel) {
return channel.name || return channel.name ||
@ -59,21 +59,22 @@ function renderClickableGDMs(mutualDms: Channel[], onClose: () => void) {
return mutualDms.map(c => ( return mutualDms.map(c => (
<Clickable <Clickable
key={c.id} key={c.id}
className={ProfileListClasses.listRow}
onClick={() => { onClick={() => {
onClose(); onClose();
SelectedChannelActionCreators.selectPrivateChannel(c.id); SelectedChannelActionCreators.selectPrivateChannel(c.id);
}} }}
> >
<Avatar <div className={MutualsListClasses.row}>
src={IconUtils.getChannelIconURL({ id: c.id, icon: c.icon, size: 32 })} <Avatar
size="SIZE_40" src={IconUtils.getChannelIconURL({ id: c.id, icon: c.icon, size: 32 })}
className={ProfileListClasses.listAvatar} size="SIZE_40"
> className={MutualsListClasses.icon}
</Avatar> >
<div className={ProfileListClasses.listRowContent}> </Avatar>
<div className={ProfileListClasses.listName}>{getGroupDMName(c)}</div> <div className={MutualsListClasses.details}>
<div className={GuildLabelClasses.guildNick}>{c.recipients.length + 1} Members</div> <div className={MutualsListClasses.name}>{getGroupDMName(c)}</div>
<div className={MutualsListClasses.nick}>{c.recipients.length + 1} Members</div>
</div>
</div> </div>
</Clickable> </Clickable>
)); ));