/** * Pantalla de Configuración. * Incluye: Configuración de usuario (idioma) y acceso a Configuración de fotos. */ import { NativeStackScreenProps } from '@react-navigation/native-stack'; import React, { useCallback, useEffect, useState } from 'react'; import { Alert, ScrollView, StyleSheet, Switch, Text, TouchableOpacity, View, } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { RootStackParamList } from '../navigation/types'; import { COLORS, PrimaryButton, SectionTitle } from '../ui/components'; import { useSession } from '../auth/session'; type Nav = NativeStackNavigationProp; export function SettingsScreen({ navigation }: NativeStackScreenProps) { const { user } = useSession(); const [language, setLanguage] = useState('en'); useEffect(() => { // Cargar idioma guardado (en un futuro usar AsyncStorage) // Por ahora, por defecto inglés setLanguage('en'); }, []); const handleLanguageChange = (lang: string) => { setLanguage(lang); // TODO: Guardar en AsyncStorage y aplicar cambio de idioma Alert.alert('Idioma', `Idioma cambiado a ${lang === 'en' ? 'Inglés' : 'Español'}. Reinicia la app para aplicar.`); }; return ( Configuración de usuario Idioma de la app handleLanguageChange('en')} > English handleLanguageChange('es')} > Español Por defecto: English Configuración de fotos navigation.navigate('PhotoSettings')} > 📷 Configuración del pie de página Personaliza logo, campos (proyecto, fecha, coordenadas) y campos personalizados Cuenta Usuario actual {user?.name ?? 'Desconocido'} Email {user?.email ?? ''} Acerca de Versión 1.0.0 Build Avante Móvil ); } const styles = StyleSheet.create({ body: { padding: 16, gap: 16 }, card: { backgroundColor: '#fff', borderRadius: 10, padding: 16, borderWidth: 1, borderColor: COLORS.border, }, row: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }, label: { fontSize: 15, fontWeight: '600', color: '#111' }, hint: { fontSize: 12, color: COLORS.muted, marginTop: 4 }, languageSelector: { flexDirection: 'row', gap: 8, marginTop: 8, }, langBtn: { flex: 1, paddingVertical: 10, paddingHorizontal: 16, borderRadius: 8, borderWidth: 1, borderColor: COLORS.border, backgroundColor: '#fff', alignItems: 'center', }, langBtnActive: { backgroundColor: COLORS.primary, borderColor: COLORS.primary, }, langBtnText: { fontSize: 14, color: COLORS.muted }, langBtnTextActive: { color: '#fff', fontWeight: '600' }, divider: { height: 1, backgroundColor: COLORS.border, marginVertical: 8 }, settingsRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingVertical: 4, }, settingsRowContent: { flexDirection: 'row', alignItems: 'center', gap: 10, }, settingsIcon: { fontSize: 20 }, settingsLabel: { fontSize: 15, fontWeight: '500', color: '#111' }, chevron: { fontSize: 20, color: COLORS.muted }, accountRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingVertical: 8, borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: COLORS.border, }, accountLabel: { fontSize: 14, color: COLORS.muted }, accountValue: { fontSize: 14, fontWeight: '600', color: '#111', textAlign: 'right', flex: 1, marginLeft: 16 }, });