import React, { useState } from "react"; import { ScrollView, StyleSheet, View, Text, TouchableOpacity, } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import { moderateScale, verticalScale, } from "react-native-size-matters"; import { router } from "expo-router"; import { Ionicons } from "@expo/vector-icons"; import { Colors } from "@/theme"; import ProfileHeader from "@/features/profile/components/ProfileHeader"; import ProfileAvatar from "@/features/profile/components/ProfileAvatar"; import ProfileOverviewCard from "@/features/profile/components/ProfileOverviewCard"; import LogoutButton from "@/features/settings/components/LogoutButton"; import LogoutConfirmModal from "@/components/LogoutConfirmModal"; import { useAuthStore } from "@/store/auth.store"; export default function ProfileOverviewScreen() { const { user, accessToken, logout } = useAuthStore(); const [logoutModalVisible, setLogoutModalVisible] = useState(false); const displayName = user?.name || "User Name"; const displayEmail = user?.email || "user@example.com"; const doLogout = () => { setLogoutModalVisible(false); logout(); router.replace("/login"); }; const handleLogout = () => { setLogoutModalVisible(true); }; if (!accessToken) { return ( Join Acupedia Sign in or create an account to unlock clinical point pathways, track your learning progress, and customize your clinical references. router.push("/login")} activeOpacity={0.85} > Log In router.push("/register")} activeOpacity={0.85} > Create Account ); } return ( { router.push("/settings"); }} /> setLogoutModalVisible(false)} onConfirm={doLogout} /> ); } const styles = StyleSheet.create({ safeArea: { flex: 1, backgroundColor: Colors.background, }, contentContainer: { flexGrow: 1, paddingBottom: verticalScale(24), }, container: { flex: 1, paddingHorizontal: moderateScale(20), paddingTop: verticalScale(12), }, guestContentContainer: { flexGrow: 1, justifyContent: "center", paddingHorizontal: moderateScale(20), paddingBottom: verticalScale(40), }, guestCard: { backgroundColor: "#FFFFFF", borderRadius: moderateScale(20), borderWidth: 1, borderColor: "#E5E7EB", padding: moderateScale(26), alignItems: "center", shadowColor: "#000000", shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.05, shadowRadius: 10, elevation: 2, }, guestIconWrapper: { marginBottom: verticalScale(14), }, guestTitle: { fontSize: moderateScale(22), fontWeight: "800", color: Colors.textPrimary, marginBottom: verticalScale(6), }, guestSubtitle: { fontSize: moderateScale(13), color: Colors.textSecondary, textAlign: "center", lineHeight: 19, marginBottom: verticalScale(24), }, guestLoginButton: { width: "100%", backgroundColor: Colors.primary, borderRadius: moderateScale(12), paddingVertical: verticalScale(13), alignItems: "center", marginBottom: verticalScale(10), }, guestLoginButtonText: { fontSize: moderateScale(15), fontWeight: "700", color: "#FFFFFF", }, guestSignupButton: { width: "100%", backgroundColor: "#FFFFFF", borderWidth: 1.5, borderColor: Colors.primary, borderRadius: moderateScale(12), paddingVertical: verticalScale(12), alignItems: "center", }, guestSignupButtonText: { fontSize: moderateScale(15), fontWeight: "700", color: Colors.primary, }, });