feat(ui): group DM chat-header polish — avatar stack, globe, cog, name + count click targets
This commit is contained in:
@@ -12,6 +12,7 @@ import { VoiceChatPanel } from '../voice/VoiceChatPanel';
|
|||||||
import { FriendsPage } from '../chat/FriendsPage';
|
import { FriendsPage } from '../chat/FriendsPage';
|
||||||
import { ExplorePage } from '../chat/ExplorePage';
|
import { ExplorePage } from '../chat/ExplorePage';
|
||||||
import { Avatar } from '../ui/Avatar';
|
import { Avatar } from '../ui/Avatar';
|
||||||
|
import { AvatarStack } from '../ui/AvatarStack';
|
||||||
import { useVoiceStore } from '../../stores/voiceStore';
|
import { useVoiceStore } from '../../stores/voiceStore';
|
||||||
import { wsSend } from '../../hooks/useWebSocket';
|
import { wsSend } from '../../hooks/useWebSocket';
|
||||||
import { MemberListToggleButton } from './MemberListToggleButton';
|
import { MemberListToggleButton } from './MemberListToggleButton';
|
||||||
@@ -181,10 +182,29 @@ export function MainContent() {
|
|||||||
)}
|
)}
|
||||||
<div className="h-14 px-5 flex items-center justify-between border-b border-border-hard flex-shrink-0 z-10 bg-surface-chat">
|
<div className="h-14 px-5 flex items-center justify-between border-b border-border-hard flex-shrink-0 z-10 bg-surface-chat">
|
||||||
<div className="flex items-center gap-[10px] min-w-0">
|
<div className="flex items-center gap-[10px] min-w-0">
|
||||||
|
{isGroupDm ? (
|
||||||
|
<div
|
||||||
|
onClick={() => openModal('groupDmSettings', { dmChannelId: currentChannelId, initialTab: 'overview' })}
|
||||||
|
className="flex-shrink-0 cursor-pointer"
|
||||||
|
aria-label="Open group settings"
|
||||||
|
>
|
||||||
|
<AvatarStack members={otherMembers} size={32} border="chat" iconUrl={dmChannel?.icon} />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" className="text-txt-tertiary flex-shrink-0">
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" className="text-txt-tertiary flex-shrink-0">
|
||||||
<path d="M12.5 2A6.5 6.5 0 0 0 6 8.5c0 1.82.75 3.47 1.95 4.65A10.02 10.02 0 0 0 2 22h2c0-4.42 3.58-8 8-8 .35 0 .69.03 1.03.07A6.49 6.49 0 0 0 19 8.5 6.5 6.5 0 0 0 12.5 2Zm0 11A4.5 4.5 0 1 1 17 8.5a4.5 4.5 0 0 1-4.5 4.5Z" />
|
<path d="M12.5 2A6.5 6.5 0 0 0 6 8.5c0 1.82.75 3.47 1.95 4.65A10.02 10.02 0 0 0 2 22h2c0-4.42 3.58-8 8-8 .35 0 .69.03 1.03.07A6.49 6.49 0 0 0 19 8.5 6.5 6.5 0 0 0 12.5 2Zm0 11A4.5 4.5 0 1 1 17 8.5a4.5 4.5 0 0 1-4.5 4.5Z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
)}
|
||||||
|
{isGroupDm ? (
|
||||||
|
<span
|
||||||
|
onClick={() => openModal('groupDmSettings', { dmChannelId: currentChannelId, initialTab: 'overview' })}
|
||||||
|
className="font-bold text-[15px] tracking-[-0.02em] text-txt-primary truncate cursor-pointer"
|
||||||
|
>
|
||||||
|
{dmName}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
<span className="font-bold text-[15px] tracking-[-0.02em] text-txt-primary truncate">{dmName}</span>
|
<span className="font-bold text-[15px] tracking-[-0.02em] text-txt-primary truncate">{dmName}</span>
|
||||||
|
)}
|
||||||
{!isGroupDm && firstOther && isFederationGlobeApplicable(firstOther) && (
|
{!isGroupDm && firstOther && isFederationGlobeApplicable(firstOther) && (
|
||||||
<Tooltip content={firstOther.username} position="bottom">
|
<Tooltip content={firstOther.username} position="bottom">
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" className="text-txt-tertiary/80 flex-shrink-0">
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" className="text-txt-tertiary/80 flex-shrink-0">
|
||||||
@@ -192,8 +212,35 @@ export function MainContent() {
|
|||||||
</svg>
|
</svg>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
{isGroupDm && (() => {
|
||||||
|
const federatedMembers = (dmChannel?.members ?? []).filter(m => isFederationGlobeApplicable(m));
|
||||||
|
if (federatedMembers.length === 0) return null;
|
||||||
|
return (
|
||||||
|
<Tooltip content={federatedMembers.map(m => m.username).join(', ')} position="bottom">
|
||||||
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" className="text-txt-tertiary/80 flex-shrink-0">
|
||||||
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" />
|
||||||
|
</svg>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
{isGroupDm && (
|
{isGroupDm && (
|
||||||
<span className="text-xs text-txt-tertiary flex-shrink-0">({dmChannel?.members.length} Members)</span>
|
<span
|
||||||
|
onClick={() => openModal('groupDmSettings', { dmChannelId: currentChannelId, initialTab: 'members' })}
|
||||||
|
className="text-xs text-txt-tertiary flex-shrink-0 cursor-pointer"
|
||||||
|
>
|
||||||
|
({dmChannel?.members.length} members)
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{isGroupDm && (
|
||||||
|
<button
|
||||||
|
onClick={() => openModal('groupDmSettings', { dmChannelId: currentChannelId, initialTab: 'overview' })}
|
||||||
|
className="w-7 h-7 flex items-center justify-center text-txt-tertiary hover:text-txt-primary transition-colors rounded-[6px] hover:bg-interactive-hover flex-shrink-0"
|
||||||
|
title="Group Settings"
|
||||||
|
>
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
|
||||||
|
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-1 flex-shrink-0">
|
<div className="flex items-center gap-1 flex-shrink-0">
|
||||||
|
|||||||
Reference in New Issue
Block a user