feat: 添加聊天会话页面,支持会话ID和标题显示,优化会话列表和搜索功能
This commit is contained in:
48
app/chat/[conversationId].tsx
Normal file
48
app/chat/[conversationId].tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import { Stack, useLocalSearchParams } from "expo-router";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
|
||||
export default function ChatConversationRoute() {
|
||||
const params = useLocalSearchParams<{ conversationId?: string; title?: string }>();
|
||||
|
||||
return (
|
||||
<View style={styles.screen}>
|
||||
<Stack.Screen options={{ title: params.title || "会话" }} />
|
||||
<View style={styles.card}>
|
||||
<Text selectable style={styles.title}>
|
||||
聊天页骨架
|
||||
</Text>
|
||||
<Text selectable style={styles.subTitle}>
|
||||
会话 ID: {params.conversationId || "-"}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
screen: {
|
||||
alignItems: "center",
|
||||
backgroundColor: "#F7F7F8",
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
paddingHorizontal: 20,
|
||||
},
|
||||
card: {
|
||||
backgroundColor: "#FFFFFF",
|
||||
borderCurve: "continuous",
|
||||
borderRadius: 20,
|
||||
gap: 8,
|
||||
paddingHorizontal: 18,
|
||||
paddingVertical: 16,
|
||||
width: "100%",
|
||||
},
|
||||
title: {
|
||||
color: "#1F2328",
|
||||
fontSize: 18,
|
||||
fontWeight: "700",
|
||||
},
|
||||
subTitle: {
|
||||
color: "#6C737F",
|
||||
fontSize: 14,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user