mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-03 08:07:21 +00:00
rename dm components for concistency
This commit is contained in:
1 parent
cb231c7770
commit
71b9c9d380
4 files changed
+13
-13
No files matched your search
@@ -14,7 +14,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
|
||||
import { ArrowLeft, Send, Loader2, AlertTriangle } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface ChatAreaProps {
|
||||
interface DMChatAreaProps {
|
||||
pubkey: string | null;
|
||||
onBack?: () => void;
|
||||
className?: string;
|
||||
@@ -147,7 +147,7 @@ const EmptyState = ({ isLoading }: { isLoading: boolean }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const ChatArea = ({ pubkey, onBack, className }: ChatAreaProps) => {
|
||||
export const DMChatArea = ({ pubkey, onBack, className }: DMChatAreaProps) => {
|
||||
const { user } = useCurrentUser();
|
||||
const { sendMessage, protocolMode, isLoading } = useDMContext();
|
||||
const { messages } = useConversationMessages(pubkey || '');
|
||||
@@ -11,7 +11,7 @@ import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface ConversationListProps {
|
||||
interface DMConversationListProps {
|
||||
selectedPubkey: string | null;
|
||||
onSelectConversation: (pubkey: string) => void;
|
||||
className?: string;
|
||||
@@ -126,12 +126,12 @@ const ConversationListSkeleton = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const ConversationList = ({
|
||||
export const DMConversationList = ({
|
||||
selectedPubkey,
|
||||
onSelectConversation,
|
||||
className,
|
||||
onStatusClick
|
||||
}: ConversationListProps) => {
|
||||
}: DMConversationListProps) => {
|
||||
const { conversations, isLoading } = useDMContext();
|
||||
const [activeTab, setActiveTab] = useState<'known' | 'requests'>('known');
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import { ConversationList } from '@/components/dm/ConversationList';
|
||||
import { ChatArea } from '@/components/dm/ChatArea';
|
||||
import { DMConversationList } from '@/components/dm/DMConversationList';
|
||||
import { DMChatArea } from '@/components/dm/DMChatArea';
|
||||
import { DMStatusInfo } from '@/components/dm/DMStatusInfo';
|
||||
import { useDMContext } from '@/contexts/DMContext';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
@@ -13,11 +13,11 @@ import {
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
|
||||
interface MessagingInterfaceProps {
|
||||
interface DMMessagingInterfaceProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const MessagingInterface = ({ className }: MessagingInterfaceProps) => {
|
||||
export const DMMessagingInterface = ({ className }: DMMessagingInterfaceProps) => {
|
||||
const [selectedPubkey, setSelectedPubkey] = useState<string | null>(null);
|
||||
const [statusModalOpen, setStatusModalOpen] = useState(false);
|
||||
const isMobile = useIsMobile();
|
||||
@@ -57,7 +57,7 @@ export const MessagingInterface = ({ className }: MessagingInterfaceProps) => {
|
||||
isMobile && !showConversationList && "hidden",
|
||||
isMobile && showConversationList && "w-full"
|
||||
)}>
|
||||
<ConversationList
|
||||
<DMConversationList
|
||||
selectedPubkey={selectedPubkey}
|
||||
onSelectConversation={handleSelectConversation}
|
||||
className="h-full"
|
||||
@@ -71,7 +71,7 @@ export const MessagingInterface = ({ className }: MessagingInterfaceProps) => {
|
||||
isMobile && !showChatArea && "hidden",
|
||||
isMobile && showChatArea && "w-full"
|
||||
)}>
|
||||
<ChatArea
|
||||
<DMChatArea
|
||||
pubkey={selectedPubkey}
|
||||
onBack={isMobile ? handleBack : undefined}
|
||||
className="h-full"
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useSeoMeta } from '@unhead/react';
|
||||
import { MessagingInterface } from '@/components/dm/MessagingInterface';
|
||||
import { DMMessagingInterface } from '@/components/dm/DMMessagingInterface';
|
||||
|
||||
const Messages = () => {
|
||||
useSeoMeta({
|
||||
@@ -10,7 +10,7 @@ const Messages = () => {
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<div className="container mx-auto p-4 h-screen flex flex-col">
|
||||
<MessagingInterface className="flex-1" />
|
||||
<DMMessagingInterface className="flex-1" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user