feat: 添加会话列表和搜索功能,重构聊天界面组件
This commit is contained in:
45
features/im/components/conversation-search-bar.tsx
Normal file
45
features/im/components/conversation-search-bar.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
||||
import { StyleSheet, TextInput, View } from "react-native";
|
||||
|
||||
type ConversationSearchBarProps = {
|
||||
value: string;
|
||||
onChangeText: (value: string) => void;
|
||||
};
|
||||
|
||||
export function ConversationSearchBar({
|
||||
value,
|
||||
onChangeText,
|
||||
}: ConversationSearchBarProps) {
|
||||
return (
|
||||
<View style={styles.wrapper}>
|
||||
<MaterialIcons color="#A2A2A7" name="search" size={28} />
|
||||
<TextInput
|
||||
onChangeText={onChangeText}
|
||||
placeholder="搜索联系人备注/昵称/ID"
|
||||
placeholderTextColor="#B8B8BC"
|
||||
style={styles.input}
|
||||
value={value}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
wrapper: {
|
||||
alignItems: "center",
|
||||
backgroundColor: "#F0F0F2",
|
||||
borderCurve: "continuous",
|
||||
borderRadius: 20,
|
||||
flexDirection: "row",
|
||||
gap: 8,
|
||||
height: 52,
|
||||
marginHorizontal: 20,
|
||||
paddingHorizontal: 16,
|
||||
},
|
||||
input: {
|
||||
color: "#2A2A2A",
|
||||
flex: 1,
|
||||
fontSize: 16,
|
||||
fontWeight: "400",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user