import { View, Text, StyleSheet, TouchableOpacity, Alert, ScrollView, Platform } from "react-native"; import { useAuthStore } from "../../src/store"; import { Ionicons } from "@expo/vector-icons"; import { LinearGradient } from "expo-linear-gradient"; import Animated, { FadeInDown } from "react-native-reanimated"; import { supabase } from "../../src/lib/supabase"; import { router } from "expo-router"; import { GradientBackground, GlassCard, GlassButton } from "../../src/components/ui"; import { colors, gradients, spacing, radius, typography, shadows } from "../../src/theme"; export default function ProfileScreen() { const { user, partner, signOut, fetchCouple } = useAuthStore(); const handleUnpair = async () => { Alert.alert( "Unpair Partner", "Are you sure you want to unpair? This cannot be undone.", [ { text: "Cancel", style: "cancel" }, { text: "Unpair", style: "destructive", onPress: async () => { try { await supabase.functions.invoke("manage-couple", { method: "DELETE", }); await fetchCouple(); } catch (error) { Alert.alert("Error", "Failed to unpair"); } }, }, ] ); }; const handleSignOut = () => { Alert.alert( "Sign Out", "Are you sure you want to sign out?", [ { text: "Cancel", style: "cancel" }, { text: "Sign Out", style: "destructive", onPress: signOut, }, ] ); }; return ( {/* Header */} Profile {/* Profile Card */} {user?.name?.[0]?.toUpperCase() || "U"} {user?.name || "User"} {user?.email} {/* Relationship Section */} Relationship {partner ? ( Paired with {partner.name || partner.email || 'your partner'} ) : ( router.push("/(app)/pairing")} activeOpacity={0.7} > Not paired yet Tap to connect with your partner )} {/* Settings Section */} Account Sign Out {/* Version */} Sauci v1.0.0 Made with love {/* Bottom spacing for tab bar */} ); } const styles = StyleSheet.create({ container: { flex: 1, }, contentContainer: { paddingBottom: Platform.OS === 'ios' ? 100 : 80, }, header: { paddingTop: 60, paddingHorizontal: spacing.lg, paddingBottom: spacing.md, }, title: { ...typography.title1, color: colors.text, }, profileCard: { marginHorizontal: spacing.lg, alignItems: "center", paddingVertical: spacing.xl, marginBottom: spacing.lg, }, avatarContainer: { width: 88, height: 88, borderRadius: 44, justifyContent: "center", alignItems: "center", marginBottom: spacing.md, ...shadows.lg, }, avatar: { width: 80, height: 80, borderRadius: 40, backgroundColor: colors.background, justifyContent: "center", alignItems: "center", }, avatarText: { fontSize: 32, fontWeight: "bold", color: colors.text, }, name: { ...typography.title2, color: colors.text, marginBottom: spacing.xs, }, email: { ...typography.subhead, color: colors.textSecondary, }, sectionTitle: { ...typography.caption1, color: colors.textTertiary, textTransform: "uppercase", letterSpacing: 1, marginBottom: spacing.sm, marginLeft: spacing.lg + spacing.xs, }, row: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", padding: spacing.md, }, rowLeft: { flexDirection: "row", alignItems: "center", flex: 1, }, rowIconContainer: { width: 40, height: 40, borderRadius: 20, backgroundColor: colors.primaryLight, justifyContent: "center", alignItems: "center", marginRight: spacing.md, }, rowIconInactive: { backgroundColor: colors.glass.background, }, rowIconDanger: { backgroundColor: colors.errorLight, }, rowLabel: { ...typography.subhead, color: colors.textSecondary, }, rowValue: { ...typography.body, color: colors.text, fontWeight: "600", }, rowValueMuted: { ...typography.caption1, color: colors.textTertiary, }, rowLabelDanger: { ...typography.body, color: colors.error, fontWeight: "500", }, rowAction: { padding: spacing.sm, }, menuRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", padding: spacing.md, }, menuRowDanger: { borderRadius: radius.lg, }, versionContainer: { alignItems: "center", marginTop: spacing.xl, }, version: { ...typography.caption1, color: colors.textTertiary, }, versionSub: { ...typography.caption2, color: colors.textTertiary, marginTop: spacing.xs, }, bottomSpacer: { height: spacing.lg, }, });