feat(tabs): 添加个人页面标签并重构标签栏布局
- 新增个人页面标签和对应的页面文件 - 将标签栏布局从垂直改为水平排列 - 隐藏顶部标题栏以提供更简洁的界面 - 调整选中状态下的内边距和间距 - 将界面文本本地化为中文 - 在图标映射中添加person图标支持
This commit is contained in:
61
components/SearchBox.tsx
Normal file
61
components/SearchBox.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
import { useThemeColor } from '@/hooks/useThemeColor';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import React from 'react';
|
||||
import { StyleSheet, TextInput, View } from 'react-native';
|
||||
|
||||
interface SearchBoxProps {
|
||||
placeholder?: string;
|
||||
value?: string;
|
||||
onChangeText?: (text: string) => void;
|
||||
}
|
||||
|
||||
export function SearchBox({ placeholder = "Search", value, onChangeText }: SearchBoxProps) {
|
||||
const backgroundColor = useThemeColor({}, 'background');
|
||||
const textColor = useThemeColor({}, 'text');
|
||||
const iconColor = useThemeColor({ light: '#9BA1A6', dark: '#687076' }, 'icon');
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: backgroundColor }]}>
|
||||
<Ionicons name="search" size={20} color={iconColor} style={styles.icon} />
|
||||
<TextInput
|
||||
style={[styles.input, { color: textColor }]}
|
||||
placeholder={placeholder}
|
||||
placeholderTextColor={iconColor}
|
||||
value={value}
|
||||
onChangeText={onChangeText}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#FFFFFF',
|
||||
borderRadius: 25,
|
||||
paddingHorizontal: 18,
|
||||
paddingVertical: 14,
|
||||
marginHorizontal: 20,
|
||||
marginVertical: 10,
|
||||
shadowColor: '#000',
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
height: 2,
|
||||
},
|
||||
shadowOpacity: 0.08,
|
||||
shadowRadius: 8,
|
||||
elevation: 3,
|
||||
borderWidth: 1,
|
||||
borderColor: '#F0F0F0',
|
||||
},
|
||||
icon: {
|
||||
marginRight: 12,
|
||||
},
|
||||
input: {
|
||||
flex: 1,
|
||||
fontSize: 16,
|
||||
color: '#333',
|
||||
height: 20,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user