feat(message): add embedded mode to ChatScreen for desktop dual-column layout
Replace EmbeddedChat with unified ChatScreen supporting embedded mode through props. Pass conversation data, layout constraints, and navigation callbacks directly to ChatScreen instead of using separate embedded component. Consolidates dual-column layout logic into single component with conditional rendering based on isEmbedded prop.
This commit is contained in:
@@ -54,8 +54,8 @@ import {
|
||||
import { Avatar, Text, EmptyState, ResponsiveContainer, AppBackButton } from '../../components/common';
|
||||
import { useResponsive, useBreakpointGTE } from '../../hooks/useResponsive';
|
||||
import * as hrefs from '../../navigation/hrefs';
|
||||
// 导入 EmbeddedChat 组件用于桌面端双栏布局
|
||||
import { EmbeddedChat } from './components/EmbeddedChat';
|
||||
// 导入 ChatScreen 组件用于桌面端双栏布局
|
||||
import { ChatScreen } from './ChatScreen';
|
||||
import { ConversationListRow } from './components/ConversationListRow';
|
||||
// 导入 NotificationsScreen 用于在内部显示
|
||||
import { NotificationsScreen } from './NotificationsScreen';
|
||||
@@ -852,9 +852,13 @@ export const MessageListScreen: React.FC = () => {
|
||||
<NotificationsScreen onBack={() => setShowNotifications(false)} />
|
||||
) : selectedConversation ? (
|
||||
// 显示选中会话的聊天内容
|
||||
<EmbeddedChat
|
||||
conversation={selectedConversation}
|
||||
onBack={() => setSelectedConversation(null)}
|
||||
<ChatScreen
|
||||
isEmbedded
|
||||
embeddedConversationId={String(selectedConversation.id)}
|
||||
embeddedIsGroupChat={selectedConversation.type === 'group'}
|
||||
embeddedGroupId={selectedConversation.group ? String(selectedConversation.group.id) : undefined}
|
||||
embeddedGroupName={selectedConversation.group?.name}
|
||||
onEmbeddedBack={() => setSelectedConversation(null)}
|
||||
/>
|
||||
) : (
|
||||
// 默认占位符
|
||||
|
||||
Reference in New Issue
Block a user