This commit is contained in:
2026-07-08 22:07:59 +02:00
parent 0b2305a3ad
commit 9be9b2987b
10 changed files with 349 additions and 268 deletions

View File

@@ -54,6 +54,10 @@ const getProfileCopy = (language: Language) => {
logoutConfirmTitle: 'Abmelden?',
logoutConfirmMessage: 'Möchtest du dich wirklich abmelden?',
logoutConfirmBtn: 'Abmelden',
guestTitle: 'Du bist noch nicht angemeldet',
guestBody: 'Melde dich an, um Pflanzen zu scannen und deine Sammlung zu sichern.',
guestSignIn: 'Anmelden',
guestSignUp: 'Kostenlos registrieren',
};
}
if (language === 'es') {
@@ -79,6 +83,10 @@ const getProfileCopy = (language: Language) => {
logoutConfirmTitle: '¿Cerrar sesión?',
logoutConfirmMessage: '¿Realmente quieres cerrar sesión?',
logoutConfirmBtn: 'Cerrar sesión',
guestTitle: 'Aún no has iniciado sesión',
guestBody: 'Inicia sesión para escanear plantas y guardar tu colección.',
guestSignIn: 'Iniciar sesión',
guestSignUp: 'Registrarse gratis',
};
}
return {
@@ -103,6 +111,10 @@ const getProfileCopy = (language: Language) => {
logoutConfirmTitle: 'Sign out?',
logoutConfirmMessage: 'Do you really want to sign out?',
logoutConfirmBtn: 'Sign Out',
guestTitle: "You're not signed in yet",
guestBody: 'Sign in to scan plants and keep your collection safe.',
guestSignIn: 'Log in',
guestSignUp: 'Sign up for free',
};
};
@@ -118,6 +130,7 @@ export default function ProfileScreen() {
profileName,
setProfileName,
signOut,
session,
} = useApp();
const router = useRouter();
@@ -199,7 +212,7 @@ export default function ProfileScreen() {
const menuItems = [
{ label: copy.menuSettings, icon: 'settings-outline', route: '/profile/preferences' as any },
{ label: copy.menuBilling, icon: 'card-outline', route: '/profile/billing' as any },
{ label: copy.menuData, icon: 'shield-checkmark-outline', route: '/profile/data' as any },
...(session ? [{ label: copy.menuData, icon: 'shield-checkmark-outline', route: '/profile/data' as any }] : []),
];
return (
@@ -228,6 +241,26 @@ export default function ProfileScreen() {
</View>
</View>
{!session ? (
<View style={[styles.card, styles.accountCard, { backgroundColor: colors.cardBg, borderColor: colors.cardBorder }]}>
<Text style={[styles.cardTitle, { color: colors.text }]}>{copy.guestTitle}</Text>
<Text style={[styles.guestBody, { color: colors.textSecondary }]}>{copy.guestBody}</Text>
<TouchableOpacity
style={[styles.guestPrimaryBtn, { backgroundColor: colors.primary }]}
onPress={() => router.push('/auth/signup')}
activeOpacity={0.85}
>
<Text style={[styles.guestPrimaryText, { color: colors.onPrimary }]}>{copy.guestSignUp}</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.guestSecondaryBtn}
onPress={() => router.push('/auth/login')}
activeOpacity={0.85}
>
<Text style={[styles.guestSecondaryText, { color: colors.primary }]}>{copy.guestSignIn}</Text>
</TouchableOpacity>
</View>
) : (
<View style={[styles.card, styles.accountCard, { backgroundColor: colors.cardBg, borderColor: colors.cardBorder }]}>
<Text style={[styles.cardTitle, { color: colors.text }]}>{copy.account}</Text>
@@ -315,6 +348,7 @@ export default function ProfileScreen() {
</TouchableOpacity>
</View>
</View>
)}
<View style={[styles.card, { backgroundColor: colors.cardBg, borderColor: colors.cardBorder, padding: 0, overflow: 'hidden' }]}>
{menuItems.map((item, idx) => (
@@ -336,6 +370,7 @@ export default function ProfileScreen() {
))}
</View>
{/* Logout */}
{session && (
<TouchableOpacity
style={[styles.logoutBtn, { borderColor: colors.dangerSoft, backgroundColor: colors.dangerSoft }]}
activeOpacity={0.78}
@@ -356,6 +391,7 @@ export default function ProfileScreen() {
<Ionicons name="log-out-outline" size={18} color={colors.danger} />
<Text style={[styles.logoutText, { color: colors.danger }]}>{copy.logout}</Text>
</TouchableOpacity>
)}
<View style={{ height: 40 }} />
</ScrollView>
@@ -387,6 +423,30 @@ const styles = StyleSheet.create({
accountCard: {
marginBottom: 14,
},
guestBody: {
fontSize: 14,
lineHeight: 20,
marginBottom: 16,
},
guestPrimaryBtn: {
height: 50,
borderRadius: 14,
alignItems: 'center',
justifyContent: 'center',
marginBottom: 8,
},
guestPrimaryText: {
fontSize: 15,
fontWeight: '800',
},
guestSecondaryBtn: {
alignItems: 'center',
paddingVertical: 10,
},
guestSecondaryText: {
fontSize: 14,
fontWeight: '700',
},
logoutBtn: {
flexDirection: 'row',
alignItems: 'center',