Files
life-echo/app-ios/app/(tabs)/index.tsx

127 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-01-31 21:20:50 +01:00
import { ConversationItem } from '@/components/chat/ConversationItem';
import { AppColors } from '@/constants/theme';
import { mockConversations } from '@/data/mockData';
import { Ionicons } from '@expo/vector-icons';
import { router } from 'expo-router';
import React from 'react';
import { ScrollView, StyleSheet, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
export default function ChatListScreen() {
const handleConversationPress = (conversationId: string) => {
router.push(`/chat/${conversationId}`);
};
return (
<SafeAreaView style={styles.container} edges={['top']}>
{/* Header */}
<View style={styles.header}>
<Text style={styles.headerTitle}></Text>
</View>
{/* Content */}
<ScrollView
style={styles.content}
contentContainerStyle={styles.contentContainer}
showsVerticalScrollIndicator={false}
>
{/* Section Title */}
<Text style={styles.sectionTitle}></Text>
{/* Conversation List */}
{mockConversations.map((conversation) => (
<React.Fragment key={conversation.id}>
<ConversationItem
conversation={conversation}
onPress={() => handleConversationPress(conversation.id)}
/>
<View style={styles.divider} />
</React.Fragment>
))}
{/* Tip Card */}
<View style={styles.tipCard}>
<View style={styles.tipHeader}>
<Ionicons
name="information-circle-outline"
size={18}
color={AppColors.mediumPurple}
/>
<Text style={styles.tipTitle}></Text>
</View>
<Text style={styles.tipContent}>
AI
</Text>
</View>
</ScrollView>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: AppColors.mediumPurple,
},
header: {
height: 62,
paddingHorizontal: 20,
justifyContent: 'center',
backgroundColor: AppColors.mediumPurple,
},
headerTitle: {
fontSize: 32,
fontWeight: '600',
color: AppColors.white,
},
content: {
flex: 1,
backgroundColor: AppColors.cream,
},
contentContainer: {
paddingBottom: 20,
},
sectionTitle: {
fontSize: 13,
color: AppColors.slatePurple,
fontWeight: '500',
letterSpacing: 0.5,
paddingHorizontal: 20,
paddingTop: 16,
paddingBottom: 10,
},
divider: {
height: 1,
backgroundColor: 'rgba(32, 0, 40, 0.06)',
marginHorizontal: 20,
},
tipCard: {
marginHorizontal: 20,
marginTop: 20,
padding: 16,
backgroundColor: AppColors.white,
borderRadius: 16,
shadowColor: AppColors.deepPurple,
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.06,
shadowRadius: 12,
elevation: 2,
},
tipHeader: {
flexDirection: 'row',
alignItems: 'center',
marginBottom: 8,
},
tipTitle: {
fontSize: 14,
fontWeight: '500',
color: AppColors.deepPurple,
marginLeft: 8,
},
tipContent: {
fontSize: 13,
color: AppColors.slatePurple,
lineHeight: 21,
},
});