import { Image } from "expo-image"; import { Stack } from "expo-router"; import React from "react"; import { useTranslation } from "react-i18next"; import { ScrollView, StyleSheet, TouchableOpacity, View } from "react-native"; import { ThemedText } from "@/components/themed-text"; import { IconSymbol } from "@/components/ui/icon-symbol"; import { useTheme } from "@/context/ThemeContext"; import { changeLanguage } from "@/i18n"; export default function ProfileScreen() { const { theme, toggleTheme, setTheme, isSystemTheme, useSystemTheme } = useTheme(); const { t, i18n } = useTranslation(); const isDark = theme === "dark"; const currentLanguage = i18n.language; const toggleLanguage = () => { const nextLang = currentLanguage.startsWith("en") ? "zh" : "en"; changeLanguage(nextLang); }; const iconColor = isDark ? "#FFFFFF" : "#000000"; const textColor = isDark ? "#FFFFFF" : "#000000"; const subTextColor = isDark ? "#AAAAAA" : "#666666"; return ( <> {/* User Info Section */} {t("profile.name")} user@example.com {/* Settings Section */} {t("settings.title")} {/* Theme Setting */} {t("settings.theme")} {theme === "light" ? t("settings.light") : t("settings.dark")} {/* Language Setting */} {t("settings.language")} {currentLanguage.startsWith("zh") ? t("settings.chinese") : t("settings.english")} ); } const styles = StyleSheet.create({ container: { flex: 1, }, section: { marginTop: 20, paddingVertical: 10, paddingHorizontal: 16, borderRadius: 10, // iOS style groups marginHorizontal: 16, }, sectionTitle: { marginLeft: 32, marginTop: 20, marginBottom: 5, fontSize: 13, textTransform: "uppercase", opacity: 0.6, }, profileHeader: { flexDirection: "row", alignItems: "center", paddingVertical: 10, }, avatar: { width: 60, height: 60, borderRadius: 30, backgroundColor: "#ccc", }, profileInfo: { marginLeft: 15, }, settingItem: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingVertical: 12, }, settingLabel: { flexDirection: "row", alignItems: "center", }, settingControl: { flexDirection: "row", alignItems: "center", }, button: { paddingHorizontal: 10, paddingVertical: 5, }, });