import { router } from 'expo-router'; import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native'; import { useTranslation } from 'react-i18next'; import { Button } from '@/src/components/Button'; import { Screen } from '@/src/components/Screen'; import { useAuth } from '@/src/context/AuthContext'; import { useAppearance } from '@/src/context/AppearanceContext'; import { APPEARANCE_OPTIONS } from '@/src/theme/appearance'; import { setAppLanguage } from '@/src/i18n'; export default function SettingsScreen() { const { t, i18n } = useTranslation(); const { user, logout } = useAuth(); const { colors, appearanceId, setAppearance } = useAppearance(); return ( {t('settings.account')} {t('auth.email')} {user?.email ?? '—'} {user?.userName ? ( <> {t('auth.displayName')} {user.userName} ) : null} {t('settings.preferences')} {t('language.label')} {(['en', 'pl'] as const).map((code) => { const selected = i18n.language.startsWith(code); return ( setAppLanguage(code)} style={[ styles.chip, { backgroundColor: selected ? colors.brand : colors.surface, borderColor: selected ? colors.brand : colors.border, }, ]} > {t(`language.${code}`)} ); })} {t('appearance.label')} {APPEARANCE_OPTIONS.map((option) => { const selected = appearanceId === option.id; return ( setAppearance(option.id)} style={[ styles.appearanceRow, { backgroundColor: colors.surface, borderColor: selected ? colors.brand : colors.border, }, ]} > {t(option.labelKey)} {t(option.descriptionKey)} ); })}