From 33abd474f6ee0a8122da0a8eff79ee6874050edd Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:04:55 +0000 Subject: [PATCH] feat(login): add loading spinner to login button Adds a loading spinner to the login button to provide feedback to the user during the login process. The button is also disabled to prevent multiple submissions. - Adds `isLoading` prop to `LoginView` - Updates `App.tsx` to manage `isLoggingIn` state - Displays spinner and disables button during login - Includes accessible text for screen readers Co-authored-by: BenjaminWie <54136562+BenjaminWie@users.noreply.github.com> --- App.tsx | 5 ++++- components/LoginView.tsx | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/App.tsx b/App.tsx index 28169f5..6537d42 100644 --- a/App.tsx +++ b/App.tsx @@ -43,6 +43,7 @@ const App: React.FC = () => { const [sessions, setSessions] = useState([]); const [currentSessionId, setCurrentSessionId] = useState(null); const [isLoading, setIsLoading] = useState(false); + const [isLoggingIn, setIsLoggingIn] = useState(false); const [isFaqGenerating, setIsFaqGenerating] = useState(false); const [generatingStatus, setGeneratingStatus] = useState(''); const [isSyncing, setIsSyncing] = useState(false); @@ -96,6 +97,7 @@ const App: React.FC = () => { }, [personas]); const handleLogin = (email: string) => { + setIsLoggingIn(true); // If we have users loaded (from NC or Init), check them const user = users.find(u => u.email.toLowerCase() === email.toLowerCase() && u.status === 'aktiv'); if (user) { @@ -103,6 +105,7 @@ const App: React.FC = () => { } else { alert("Zugang verweigert. Nur verifizierte Wohnpro-Bewohner können sich im Wohnpro Guide anmelden."); } + setIsLoggingIn(false); }; const sendMessage = async (text: string) => { @@ -256,7 +259,7 @@ const App: React.FC = () => { Synchronisiere mit Nextcloud... )} - + ); } diff --git a/components/LoginView.tsx b/components/LoginView.tsx index a7c3c0b..2b380ae 100644 --- a/components/LoginView.tsx +++ b/components/LoginView.tsx @@ -5,9 +5,10 @@ import { User } from '../types'; interface LoginViewProps { onLogin: (email: string) => void; error?: string; + isLoading: boolean; } -const LoginView: React.FC = ({ onLogin, error: externalError }) => { +const LoginView: React.FC = ({ onLogin, error: externalError, isLoading }) => { const [email, setEmail] = useState(''); const [error, setError] = useState(externalError || ''); @@ -48,9 +49,17 @@ const LoginView: React.FC = ({ onLogin, error: externalError })