fix(chat-list): show separate pin and mute indicators without replacing avatar
Some checks failed
CI / test (push) Failing after 1m38s
Some checks failed
CI / test (push) Failing after 1m38s
This commit is contained in:
@@ -240,7 +240,7 @@ export function ChatList() {
|
||||
<img alt="chat avatar" className="h-10 w-10 rounded-full object-cover" src={chatAvatar(chat)!} />
|
||||
) : (
|
||||
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-sky-500/30 text-sm font-semibold uppercase text-sky-100">
|
||||
{chat.pinned ? "📌" : (chat.display_title || chat.title || chat.type).slice(0, 1)}
|
||||
{(chat.display_title || chat.title || chat.type).slice(0, 1)}
|
||||
</div>
|
||||
)}
|
||||
{chat.type === "private" && chat.counterpart_is_online ? (
|
||||
@@ -250,6 +250,17 @@ export function ChatList() {
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="truncate text-sm font-semibold">{chatLabel(chat)}</p>
|
||||
<span className="inline-flex shrink-0 items-center gap-1.5">
|
||||
{chat.pinned ? (
|
||||
<span className="text-[11px] text-slate-400" title="Pinned chat">
|
||||
📌
|
||||
</span>
|
||||
) : null}
|
||||
{chat.muted ? (
|
||||
<span className="text-[11px] text-slate-400" title="Muted chat">
|
||||
🔕
|
||||
</span>
|
||||
) : null}
|
||||
{(chat.unread_count ?? 0) > 0 || (chat.unread_mentions_count ?? 0) > 0 ? (
|
||||
<span className="inline-flex items-center gap-1">
|
||||
{(chat.unread_mentions_count ?? 0) > 0 ? (
|
||||
@@ -264,10 +275,11 @@ export function ChatList() {
|
||||
) : null}
|
||||
</span>
|
||||
) : (
|
||||
<span className="shrink-0 text-[11px] text-slate-400">
|
||||
<span className="text-[11px] text-slate-400">
|
||||
{formatChatListTime(chat.last_message_created_at)}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="truncate text-xs text-slate-400">{chatPreviewLabel(chat)}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user