feat: update app configuration and enhance UI components

This commit is contained in:
2026-02-06 18:06:48 +01:00
parent 7c8ef45e5a
commit 882cfc281d
19 changed files with 339 additions and 266 deletions

View File

@@ -3,7 +3,8 @@ import api from '@/utils/api';
import { AuthContext } from '@/utils/authContext';
import { Eye, EyeOff, Lock, LogIn, Mail } from 'lucide-react-native';
import React, { useContext, useState } from 'react';
import { Image, KeyboardAvoidingView, Platform, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { Image, Platform, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { KeyboardAvoidingView } from 'react-native-keyboard-controller';
export default function LoginScreen() {
const alert = useAlert();
@@ -15,7 +16,7 @@ export default function LoginScreen() {
// Login Handler function
const handleLogin = async () => {
if (!username || !password) {
if (!username || !password) {
alert.showAlert('error', 'Attenzione', 'Inserisci username e password');
return;
}
@@ -41,7 +42,7 @@ export default function LoginScreen() {
} catch (error: any) {
console.error("Login Error:", error);
let message = "Si è verificato un errore durante l'accesso.";
if (error.response) {
// Server error (e.g., 401 Invalid credentials)
if (error.response.status === 401) {
@@ -74,8 +75,9 @@ export default function LoginScreen() {
{/* Form Container */}
<View className="flex-1 bg-white rounded-t-[2.5rem] px-8 pt-10 shadow-xl w-full">
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
className="flex-1"
behavior={"padding"}
keyboardVerticalOffset={100}
className='flex-1 mh-600'
>
<ScrollView showsVerticalScrollIndicator={false} className="h-full">
<View className="gap-6 flex flex-col" style={{ gap: '1.5rem' }}>