diff --git a/frontend/src/components/ChatHeader.tsx b/frontend/src/components/ChatHeader.tsx index 629644a..e9642b4 100644 --- a/frontend/src/components/ChatHeader.tsx +++ b/frontend/src/components/ChatHeader.tsx @@ -9,6 +9,7 @@ import { handleKeyboardActivate } from '../utils/a11y'; import { isPublicChannelKey } from '../utils/publicChannel'; import { stripRegionScopePrefix } from '../utils/regionScope'; import { isPrefixOnlyContact } from '../utils/pubkey'; +import { cn } from '../lib/utils'; import { ContactAvatar } from './ContactAvatar'; import { ContactStatusInfo } from './ContactStatusInfo'; import type { @@ -118,8 +119,15 @@ export function ChatHeader({ }; return ( -
- +
+ {conversation.type === 'contact' && onOpenContactInfo && ( )} - - -

- {titleClickable ? ( - + ) : ( {conversation.type === 'channel' && !conversation.name.startsWith('#') && @@ -155,83 +178,72 @@ export function ChatHeader({ : ''} {conversation.name} -

+ {isPrivateChannel && !showKey ? ( + ) : ( - - {conversation.type === 'channel' && - !conversation.name.startsWith('#') && - activeChannel?.is_hashtag - ? '#' - : ''} - {conversation.name} + { + e.stopPropagation(); + navigator.clipboard.writeText(conversation.id); + toast.success( + conversation.type === 'channel' ? 'Room key copied!' : 'Contact key copied!' + ); + }} + title="Click to copy" + aria-label={ + conversation.type === 'channel' ? 'Copy channel key' : 'Copy contact key' + } + > + {conversation.type === 'channel' + ? conversation.id.toLowerCase() + : conversation.id} )} - - {isPrivateChannel && !showKey ? ( + + {conversation.type === 'channel' && activeFloodScopeDisplay && ( - ) : ( - { - e.stopPropagation(); - navigator.clipboard.writeText(conversation.id); - toast.success( - conversation.type === 'channel' ? 'Room key copied!' : 'Contact key copied!' - ); - }} - title="Click to copy" - aria-label={ - conversation.type === 'channel' ? 'Copy channel key' : 'Copy contact key' - } - > - {conversation.type === 'channel' ? conversation.id.toLowerCase() : conversation.id} - )}
- {conversation.type === 'contact' && activeContact && ( - - - - )} - {conversation.type === 'channel' && activeFloodScopeDisplay && ( - - )}
-
+ {conversation.type === 'contact' && activeContact && ( +
+ +
+ )} +
{conversation.type === 'contact' && !activeContactIsRoomServer && (