diff --git a/components/LoginView.tsx b/components/LoginView.tsx index a7c3c0b..fb45760 100644 --- a/components/LoginView.tsx +++ b/components/LoginView.tsx @@ -10,6 +10,7 @@ interface LoginViewProps { const LoginView: React.FC = ({ onLogin, error: externalError }) => { const [email, setEmail] = useState(''); const [error, setError] = useState(externalError || ''); + const [isLoading, setIsLoading] = useState(false); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); @@ -17,7 +18,15 @@ const LoginView: React.FC = ({ onLogin, error: externalError }) setError('Bitte gib deine Wohnpro E-Mail Adresse ein.'); return; } - onLogin(email); + setIsLoading(true); + + // Simulate network delay for better UX feedback + setTimeout(() => { + onLogin(email); + // If login fails, we need to re-enable the button. + // If it succeeds, this component unmounts anyway. + setIsLoading(false); + }, 1000); }; return ( @@ -48,9 +57,14 @@ const LoginView: React.FC = ({ onLogin, error: externalError })