diff --git a/src/components/dm/ConversationList.tsx b/src/components/dm/ConversationList.tsx index 5f4ff24..b72ecbe 100644 --- a/src/components/dm/ConversationList.tsx +++ b/src/components/dm/ConversationList.tsx @@ -1,9 +1,10 @@ import { useMemo, useState } from 'react'; -import { AlertTriangle } from 'lucide-react'; +import { AlertTriangle, Info } from 'lucide-react'; import { useDMContext } from '@/contexts/DMContext'; import { useAuthor } from '@/hooks/useAuthor'; import { genUserName } from '@/lib/genUserName'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; +import { Button } from '@/components/ui/button'; import { Card } from '@/components/ui/card'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Skeleton } from '@/components/ui/skeleton'; @@ -14,6 +15,7 @@ interface ConversationListProps { selectedPubkey: string | null; onSelectConversation: (pubkey: string) => void; className?: string; + onStatusClick?: () => void; } const ConversationItem = ({ @@ -127,7 +129,8 @@ const ConversationListSkeleton = () => { export const ConversationList = ({ selectedPubkey, onSelectConversation, - className + className, + onStatusClick }: ConversationListProps) => { const { conversations, isLoading } = useDMContext(); const [activeTab, setActiveTab] = useState<'known' | 'requests'>('known'); @@ -164,8 +167,19 @@ export const ConversationList = ({ return ( -
+

Messages

+ {onStatusClick && ( + + )}
{/* Tab buttons */} diff --git a/src/pages/Messages.tsx b/src/pages/Messages.tsx index 065cf11..d4c3f65 100644 --- a/src/pages/Messages.tsx +++ b/src/pages/Messages.tsx @@ -1,5 +1,4 @@ import { useState } from 'react'; -import { Info } from 'lucide-react'; import { useSeoMeta } from '@unhead/react'; import { ConversationList } from '@/components/dm/ConversationList'; import { ChatArea } from '@/components/dm/ChatArea'; @@ -13,9 +12,7 @@ import { DialogDescription, DialogHeader, DialogTitle, - DialogTrigger, } from '@/components/ui/dialog'; -import { Button } from '@/components/ui/button'; const Messages = () => { const [selectedPubkey, setSelectedPubkey] = useState(null); @@ -43,33 +40,18 @@ const Messages = () => { return (
- {/* Header with status button */} -
-

Messages

- - {/* Status Modal */} - - - - - - - Messaging Status - - View loading status, cache info, and connection details - - - - - -
+ {/* Status Modal */} + + + + Messaging Status + + View loading status, cache info, and connection details + + + + +
{/* Conversation List - Left Sidebar */} @@ -82,6 +64,7 @@ const Messages = () => { selectedPubkey={selectedPubkey} onSelectConversation={handleSelectConversation} className="h-full" + onStatusClick={() => setStatusModalOpen(true)} />