From eb2876b8e489fb52e0ac1aba17dddead02b737f2 Mon Sep 17 00:00:00 2001 From: Anita Date: Sun, 5 Apr 2026 21:37:06 +0100 Subject: feat: pantallas auth rediseñadas y ajustes visuales en home y layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(auth)/login.tsx | 208 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 162 insertions(+), 46 deletions(-) (limited to 'src/app/(auth)/login.tsx') diff --git a/src/app/(auth)/login.tsx b/src/app/(auth)/login.tsx index 7457b54..bf4eda7 100644 --- a/src/app/(auth)/login.tsx +++ b/src/app/(auth)/login.tsx @@ -1,78 +1,194 @@ import { Link } from 'expo-router'; import { Pressable, StyleSheet, Text, TextInput, View } from 'react-native'; +import { MaterialIcons } from '@expo/vector-icons'; +import theme from '@/theme'; import { useLogin } from '@/features/auth/hooks/useLogin'; import { StatusMessage } from '@/shared/ui/StatusMessage'; +const { colors, spacing, radius, typography, fontWeight, layout, shadows } = theme; + export default function LoginScreen() { + // hook de login const { email, password, setEmail, setPassword, submit, isSubmitting, error } = useLogin(); return ( - Iniciar sesión - - - - - - {error ? : null} - - - - {isSubmitting ? 'Entrando...' : 'Entrar'} - - - - - ¿No tienes cuenta? Regístrate - + {/* contenido central acotado */} + + {/* icono superior */} + + + + + {/* titulo principal */} + Iniciar sesión + + {/* subtitulo */} + Accede a tu cuenta de App Oficina + + {/* tarjeta del formulario */} + + {/* campo correo */} + Correo electrónico + + + {/* campo contraseña */} + Contraseña + + + {/* enlace visual de recuperar contraseña */} + ¿Olvidaste tu contraseña? + + {/* mensaje de error */} + {error ? : null} + + {/* boton principal */} + + + {isSubmitting ? 'Entrando...' : 'Acceder'} + + + + + {/* enlace inferior a registro */} + + ¿No tienes cuenta? Regístrate aquí + + ); } const styles = StyleSheet.create({ + // contenedor principal de la pantalla container: { flex: 1, + backgroundColor: colors.background, + }, + + // contenido central acotado y centrado + content: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + paddingHorizontal: spacing.xl, + paddingTop: spacing.xl, + paddingBottom: spacing.xl, + gap: spacing.lg, + maxWidth: layout.contentWidth, + width: '100%', + alignSelf: 'center', + }, + + // caja azul del icono superior + iconBox: { + width: 56, + height: 56, + borderRadius: radius.lg, + backgroundColor: colors.primary, + alignItems: 'center', justifyContent: 'center', - padding: 24, - gap: 12, + alignSelf: 'center', + ...shadows.card, }, + + // titulo principal title: { - fontSize: 28, - fontWeight: '700', - marginBottom: 16, + fontSize: 36, + fontWeight: fontWeight.semibold, + color: colors.text, + textAlign: 'center', + }, + + // subtitulo explicativo + subtitle: { + fontSize: typography.md, + color: colors.textSecondary, + textAlign: 'center', + lineHeight: 22, }, + + // tarjeta del formulario de login + formCard: { + width: '100%', + backgroundColor: colors.surface, + borderRadius: radius.xxl, + borderWidth: 1, + borderColor: colors.border, + padding: spacing.lg, + gap: spacing.md, + ...shadows.card, + }, + + // texto de etiqueta de los inputs + label: { + fontSize: typography.sm, + color: colors.text, + fontWeight: fontWeight.medium, + }, + + // input de formulario input: { borderWidth: 1, - borderColor: '#ccc', - borderRadius: 10, - paddingHorizontal: 14, - paddingVertical: 12, + borderColor: colors.border, + borderRadius: radius.md, + paddingHorizontal: spacing.lg, + paddingVertical: spacing.md, + backgroundColor: colors.background, + color: colors.text, }, + + // texto de recuperar contraseña + forgotPassword: { + fontSize: typography.sm, + color: colors.primary, + textAlign: 'right', + marginTop: spacing.xs, + }, + + // boton principal button: { - backgroundColor: '#1f6feb', - paddingVertical: 14, - borderRadius: 10, + backgroundColor: colors.primary, + paddingVertical: spacing.lg, + borderRadius: radius.md, alignItems: 'center', - marginTop: 8, + justifyContent: 'center', + marginTop: spacing.sm, }, + + // texto del boton principal buttonText: { - color: '#fff', - fontWeight: '600', + color: colors.white, + fontWeight: fontWeight.semibold, + fontSize: typography.md, }, + + // enlace inferior link: { - marginTop: 12, + marginTop: spacing.sm, + fontSize: typography.md, + color: colors.textSecondary, + textAlign: 'center', + }, + + // parte destacada del enlace + linkHighlight: { + color: colors.primary, + fontWeight: fontWeight.medium, }, }); -- cgit v1.2.3-54-g00ecf