diff --git a/app/protected/messages/page.tsx b/app/protected/messages/page.tsx index 5e7c9a00..816e70e0 100644 --- a/app/protected/messages/page.tsx +++ b/app/protected/messages/page.tsx @@ -22,6 +22,14 @@ export default function MessagesPage() { // Track user's online presence useMyPresence() + // Prevent body scroll + useEffect(() => { + document.body.style.overflow = 'hidden' + return () => { + document.body.style.overflow = 'unset' + } + }, []) + // Get conversation from URL params useEffect(() => { const conversationId = searchParams.get('conversation') @@ -53,15 +61,20 @@ export default function MessagesPage() { : 'Unknown' return ( -
+
{/* Header */} -
+
- -

Messages

+
+ +
+

Messages

- -

{conversationName}

+

{conversationName}

{!selectedConversation.is_group && selectedConversation.other_user && selectedConversation.other_user.id ? ( - -

No conversations yet

-

+

+ +
+

No conversations yet

+

Start a new conversation to get started

@@ -87,13 +89,13 @@ export function ConversationList({ conversations, selectedId, onSelect, loading key={conversation.id} onClick={() => onSelect(conversation.id)} className={cn( - 'w-full flex items-center gap-3 p-3 rounded-lg transition-colors text-left', - 'hover:bg-muted', - isSelected && 'bg-muted' + 'w-full flex items-center gap-3 p-3 rounded-lg transition-all text-left', + 'hover:bg-zinc-900', + isSelected && 'bg-zinc-900 border border-zinc-800' )} >
- + {avatarUrl && } {initials} @@ -111,11 +113,14 @@ export function ConversationList({ conversations, selectedId, onSelect, loading
- 0 && 'text-primary')}> + 0 ? 'text-blue-400' : 'text-white' + )}> {name} {conversation.last_message_at && ( - + {formatDistanceToNow(new Date(conversation.last_message_at), { addSuffix: true })} )} @@ -123,12 +128,12 @@ export function ConversationList({ conversations, selectedId, onSelect, loading

0 ? 'font-medium text-foreground' : 'text-muted-foreground' + conversation.unread_count > 0 ? 'font-medium text-zinc-300' : 'text-zinc-500' )}> {conversation.last_message_content || 'No messages yet'}

{conversation.unread_count > 0 && ( - + {conversation.unread_count} )} diff --git a/components/messages/ConversationView.tsx b/components/messages/ConversationView.tsx index a3ec3ff5..f7579925 100644 --- a/components/messages/ConversationView.tsx +++ b/components/messages/ConversationView.tsx @@ -28,10 +28,12 @@ export function ConversationView({ conversationId }: ConversationViewProps) { if (!conversationId) { return ( -
- -

Select a conversation

-

+

+
+ +
+

Select a conversation

+

Choose a conversation from the list to start messaging

@@ -57,14 +59,16 @@ export function ConversationView({ conversationId }: ConversationViewProps) { } return ( -
+
{/* Messages Area */}
{messages.length === 0 ? (
- -

No messages yet

-

+

+ +
+

No messages yet

+

Send a message to start the conversation

@@ -88,7 +92,7 @@ export function ConversationView({ conversationId }: ConversationViewProps) { )} {/* Message Input */} -
+
{!isOwn && ( - + {getName()} )}
@@ -59,7 +59,7 @@ export function MessageBubble({ message, isOwn }: MessageBubbleProps) { )}
- + {formatDistanceToNow(new Date(message.created_at), { addSuffix: true })}
diff --git a/components/messages/MessageInput.tsx b/components/messages/MessageInput.tsx index 566f274c..aaec729c 100644 --- a/components/messages/MessageInput.tsx +++ b/components/messages/MessageInput.tsx @@ -90,7 +90,7 @@ export function MessageInput({ onSend, disabled, placeholder = 'Type a message.. }, [content, isTyping, onTyping]) return ( -
+