priviate group avatars update

This commit is contained in:
2026-03-28 12:02:57 -04:00
parent d7790bb7ef
commit eb3e45d88f
3 changed files with 43 additions and 6 deletions

View File

@@ -33,15 +33,15 @@ const COMPOSITE_LAYOUTS = {
],
};
function GroupAvatarComposite({ memberPreviews, fallbackLabel, fallbackColor }) {
function GroupAvatarComposite({ memberPreviews }) {
const members = (memberPreviews || []).slice(0, 4);
const n = members.length;
const positions = COMPOSITE_LAYOUTS[n];
if (!positions) {
return (
<div className="group-icon" style={{ background: fallbackColor, borderRadius: 8, fontSize: 11, fontWeight: 700 }}>
{fallbackLabel}
<div className="group-icon" style={{ background: '#a142f4', borderRadius: 8, fontSize: 11, fontWeight: 700 }}>
?
</div>
);
}
@@ -165,9 +165,11 @@ export default function Sidebar({ groups, activeGroupId, onSelectGroup, notifica
{(group.peer_real_name || group.name)[0]?.toUpperCase()}
</div>
) : group.is_managed && group.is_multi_group ? (
<GroupAvatarComposite memberPreviews={group.member_previews} fallbackLabel="MG" fallbackColor={settings.color_avatar_dm || '#a142f4'} />
<div className="group-icon" style={{ background: settings.color_avatar_dm || '#a142f4', borderRadius: 8, fontSize: 11, fontWeight: 700 }}>MG</div>
) : group.is_managed ? (
<GroupAvatarComposite memberPreviews={group.member_previews} fallbackLabel="UG" fallbackColor={settings.color_avatar_dm || '#a142f4'} />
<div className="group-icon" style={{ background: settings.color_avatar_dm || '#a142f4', borderRadius: 8, fontSize: 11, fontWeight: 700 }}>UG</div>
) : group.composite_members?.length > 0 ? (
<GroupAvatarComposite memberPreviews={group.composite_members} />
) : (
<div className="group-icon" style={{ background: group.type === 'public' ? (settings.color_avatar_public || '#1a73e8') : (settings.color_avatar_dm || '#a142f4') }}>
{group.type === 'public' ? '#' : group.name[0]?.toUpperCase()}
@@ -231,7 +233,7 @@ export default function Sidebar({ groups, activeGroupId, onSelectGroup, notifica
)}
{groupMessagesMode && privateFiltered.length > 0 && (
<div className="group-section">
<div className="section-label">PRIVATE GROUP MESSAGES</div>
<div className="section-label">USER GROUP MESSAGES</div>
{privateFiltered.map(g => <GroupItem key={g.id} group={g} />)}
</div>
)}