import { useEffect } from "react"; import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from "react-native"; import { useAuthStore, useMatchStore, usePacksStore } from "../../src/store"; import { Ionicons } from "@expo/vector-icons"; import { router } from "expo-router"; export default function HomeScreen() { const { user, partner } = useAuthStore(); const { matches, newMatchesCount, fetchMatches } = useMatchStore(); const { packs, fetchPacks } = usePacksStore(); useEffect(() => { fetchMatches(); fetchPacks(); }, []); const recentMatches = matches.slice(0, 3); return ( Hey, {user?.name || "there"} 👋 {partner && ( Paired with {partner.name || partner.email || 'your partner'} )} {/* Quick Stats */} {matches.length} Matches {packs.length} Packs {newMatchesCount} New {/* Start Playing CTA */} router.push("/(app)/swipe")} > Ready to explore? Swipe through questions and discover what you both enjoy {/* Recent Matches */} {recentMatches.length > 0 && ( Recent Matches router.push("/(app)/matches")}> See all {recentMatches.map((match) => ( {(match as any).question?.text || "A new match!"} {match.is_new && } ))} )} ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#1a1a2e", }, header: { paddingTop: 60, paddingHorizontal: 24, paddingBottom: 24, }, greeting: { fontSize: 28, fontWeight: "bold", color: "#fff", }, partnerText: { fontSize: 14, color: "#888", marginTop: 4, }, statsContainer: { flexDirection: "row", paddingHorizontal: 24, gap: 12, }, statCard: { flex: 1, backgroundColor: "#16213e", borderRadius: 16, padding: 16, alignItems: "center", borderWidth: 1, borderColor: "#0f3460", }, statNumber: { fontSize: 24, fontWeight: "bold", color: "#fff", marginTop: 8, }, statLabel: { fontSize: 12, color: "#888", marginTop: 4, }, ctaCard: { margin: 24, backgroundColor: "#e94560", borderRadius: 16, padding: 20, flexDirection: "row", alignItems: "center", }, ctaContent: { flex: 1, }, ctaTitle: { fontSize: 18, fontWeight: "bold", color: "#fff", }, ctaSubtitle: { fontSize: 14, color: "rgba(255,255,255,0.8)", marginTop: 4, }, section: { paddingHorizontal: 24, marginBottom: 24, }, sectionHeader: { flexDirection: "row", justifyContent: "space-between", alignItems: "center", marginBottom: 16, }, sectionTitle: { fontSize: 18, fontWeight: "600", color: "#fff", }, seeAll: { color: "#e94560", fontSize: 14, }, matchItem: { flexDirection: "row", alignItems: "center", backgroundColor: "#16213e", borderRadius: 12, padding: 16, marginBottom: 8, borderWidth: 1, borderColor: "#0f3460", }, matchIcon: { width: 40, height: 40, borderRadius: 20, backgroundColor: "rgba(233, 69, 96, 0.2)", justifyContent: "center", alignItems: "center", marginRight: 12, }, matchText: { flex: 1, color: "#fff", fontSize: 14, }, newBadge: { width: 8, height: 8, borderRadius: 4, backgroundColor: "#e94560", }, });