import React, { useState } from 'react'; import { View, Text, StyleSheet, TextInput, Pressable, KeyboardAvoidingView, Platform, Alert, Image } from 'react-native'; import { router } from 'expo-router'; import Animated, { FadeInDown, FadeInUp } from 'react-native-reanimated'; import { COLORS, SPACING, TYPOGRAPHY, BORDER_RADIUS, SHADOWS } from '../../../constants/theme'; import { Button } from '../../../components/ui/Button'; import { Mail, Lock, Scissors } from 'lucide-react-native'; import * as Haptics from 'expo-haptics'; import { useLanguage } from '../../../stores/LanguageContext'; import { useBarbearia } from '../../../stores/BarbeariaContext'; export default function LoginScreen() { const { t } = useLanguage(); const { barbearia } = useBarbearia(); const colors = barbearia?.colors || COLORS; const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); const handleLogin = async () => { if (!email || !password) { if (Platform.OS === 'web') { window.alert(t('login.email') + ' / ' + t('login.password')); } else { Alert.alert('Erro', t('login.email') + ' / ' + t('login.password')); } return; } setIsLoading(true); Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium); // Simulação de autenticação setTimeout(() => { setIsLoading(false); // Navega para a tela de agendamento dentro do slug da barbearia atual router.replace(`/${barbearia?.slug}/(tabs)/agendar`); }, 1500); }; return ( {barbearia?.logo ? ( ) : ( )} {barbearia?.nome || t('login.title')} {t('login.tagline')} { router.push(`/${barbearia?.slug}/(auth)/forgot-password`); }} style={styles.forgotPassword} > {t('login.forgot')}