1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

add usermention component for dms

This commit is contained in:
Elvy 2025-01-04 18:49:04 +01:00
parent f36e5a3a81
commit 60219b3b0b

View file

@ -173,6 +173,24 @@ export function SettingArrayComponent({
channels[channel.guild_id].push(channel);
}
const userMention = channel => {
return <UserMentionComponent
userId={channel.recipients[0]}
className="mention"
/>;
};
const gdmComponent = channel => {
return <span style={{ display: "inline-flex", alignItems: "center" }}>
{channel.recipients.length >= 2 && channel.icon == null ? (
<GroupDMAvatars recipients={channel.recipients} size="SIZE_16" />
) : (
<Avatar src={getDMChannelIcon(channel)} size="SIZE_16" />
)}
<Text variant="text-sm/semibold" style={{ marginLeft: "4px" }}>{channel.name}</Text>
</span>;
};
if (dmChannels.length > 0) {
elements.push(
<details>
@ -187,15 +205,8 @@ export function SettingArrayComponent({
marginBottom: "8px",
}}
>
<span style={{ display: "inline-flex", alignItems: "center" }}>
{channel.recipients.length >= 2 && channel.icon == null ? (
<GroupDMAvatars recipients={channel.recipients} size="SIZE_16" />
) : (
<Avatar src={getDMChannelIcon(channel)} size="SIZE_16" />
)}
<Text variant="text-sm/semibold" style={{ marginLeft: "4px" }}>{channel.name}</Text>
{channel.recipients.length === 1 ? userMention(channel) : gdmComponent(channel)}
{removeButton(index)}
</span>
</Flex>
))}
</div>