import React, { useState, useEffect } from 'react'; import { View, Text, StyleSheet, ScrollView, Platform } from 'react-native'; import { Feather } from '@expo/vector-icons'; import { useAppTheme } from '../../context/ThemeContext'; import { AppScreen } from '../../components/AppScreen'; import { AISectionHeader, AISkeleton, AIPressable } from '../../components/UI'; import { useTranslation } from '../../context/LanguageContext'; import { MOCK_NOTIFICATIONS } from '../../constants/mocks'; import { PALETTE } from '../../constants/theme'; import * as Haptics from 'expo-haptics'; const LIME = PALETTE.lime; const TYPE_MAP: Record = { success: { icon: 'check-circle', color: LIME }, info: { icon: 'info', color: '#3B82F6' }, warning: { icon: 'alert-circle', color: '#F59E0B' }, alert: { icon: 'shield', color: '#EF4444' }, update: { icon: 'refresh-cw', color: '#8B5CF6' }, }; // Mock data moved to constants/mocks.ts export default function NotificationsScreen() { const { colors, isDark } = useAppTheme(); const { t } = useTranslation(); const [loading, setLoading] = useState(true); useEffect(() => { const timer = setTimeout(() => setLoading(false), 1500); return () => clearTimeout(timer); }, []); const cardBg = colors.surface; const border = colors.border; const subText = colors.textSecondary; const renderSkeleton = () => ( {[1, 2, 3, 4].map(i => ( ))} ); if (loading) return {renderSkeleton()}; return ( {/* Header */} {t.notifications || 'Activity'} {MOCK_NOTIFICATIONS.length} {t.recentNotifications || 'recent notifications'} {/* List */} {MOCK_NOTIFICATIONS.map((item, index) => { const meta = TYPE_MAP[item.type] || TYPE_MAP.info; return ( { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); }} style={styles.notifPressable} > {/* Left: colored icon */} {/* Body */} {item.title} {item.time} {item.desc} ); })} ); } const styles = StyleSheet.create({ header: { paddingHorizontal: 24, paddingTop: 20, marginBottom: 22 }, title: { fontSize: 32, fontFamily: 'Outfit_800ExtraBold', letterSpacing: -0.5 }, subtitle: { fontSize: 13, fontFamily: 'Outfit_400Regular', marginTop: 4 }, list: { paddingHorizontal: 24 }, notifPressable: { marginBottom: 10 }, card: { flexDirection: 'row', alignItems: 'flex-start', padding: 16, borderRadius: 20, borderWidth: 1, }, iconBox: { width: 48, height: 48, borderRadius: 14, alignItems: 'center', justifyContent: 'center', marginRight: 14, flexShrink: 0, }, body: { flex: 1 }, topRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 4 }, notifTitle: { fontSize: 15, fontFamily: 'Outfit_700Bold', flex: 1, marginRight: 8 }, time: { fontSize: 11, fontFamily: 'Outfit_500Medium', flexShrink: 0, marginTop: 1 }, desc: { fontSize: 13, fontFamily: 'Outfit_400Regular', lineHeight: 18 }, });