From 53e1af519635a814ae42b8837ebde745c63a7bae Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Fri, 9 Oct 2026 06:33:27 +0200 Subject: [PATCH] feat(mobile): Login und Registrierung neu gestaltet (Logo, Animationen, Android-Gesten) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gemeinsamer AuthShell: Logo + Wortmarke oben, Sprach-Chip mit Menü, Formular unten in der Daumenzone, Apple/Google unter "oder weiter mit" - Animationen mit eingebautem Animated (OTA-fähig): Logo federt rein, gestaffeltes Einblenden, Fokusrahmen, Ladekringel, Wackeln bei Fehler; respektiert "Bewegung reduzieren" - Android: Safe-Area für Status- und Gestenleiste, Seitenrand außerhalb der Zurück-Wischzone, Sprachmenü als Modal (Zurück schließt nur das Menü), KeyboardAvoidingView auch auf Android (Edge-to-Edge) - Registrierung: Google/Apple nicht mehr ausgegraut; ohne Zustimmung markiert ein Tipp die Checkbox und zeigt einen Hinweis Co-Authored-By: Claude Opus 5.5 --- mobile/app/(auth)/sign-in.tsx | 175 +++++++------ mobile/app/(auth)/sign-up.tsx | 243 ++++++++++++------- mobile/found.md | 3 + mobile/src/components/AppleSignInButton.tsx | 5 +- mobile/src/components/Button.tsx | 14 +- mobile/src/components/GoogleSignInButton.tsx | 6 +- mobile/src/components/LanguageSwitcher.tsx | 18 +- mobile/src/components/auth/AuthField.tsx | 80 ++++++ mobile/src/components/auth/AuthLogo.tsx | 83 +++++++ mobile/src/components/auth/AuthShell.tsx | 118 +++++++++ mobile/src/components/auth/LanguageChip.tsx | 122 ++++++++++ mobile/src/components/auth/Reveal.tsx | 40 +++ mobile/src/hooks/useReducedMotion.ts | 15 ++ mobile/src/hooks/useShake.ts | 22 ++ mobile/src/i18n/locales/de.json | 16 +- mobile/src/i18n/locales/en.json | 16 +- 16 files changed, 786 insertions(+), 190 deletions(-) create mode 100644 mobile/src/components/auth/AuthField.tsx create mode 100644 mobile/src/components/auth/AuthLogo.tsx create mode 100644 mobile/src/components/auth/AuthShell.tsx create mode 100644 mobile/src/components/auth/LanguageChip.tsx create mode 100644 mobile/src/components/auth/Reveal.tsx create mode 100644 mobile/src/hooks/useReducedMotion.ts create mode 100644 mobile/src/hooks/useShake.ts diff --git a/mobile/app/(auth)/sign-in.tsx b/mobile/app/(auth)/sign-in.tsx index 61524e3..2a73d18 100644 --- a/mobile/app/(auth)/sign-in.tsx +++ b/mobile/app/(auth)/sign-in.tsx @@ -1,14 +1,16 @@ import { useMemo, useState } from "react"; -import { View, Text, Pressable, StyleSheet, KeyboardAvoidingView, ScrollView, Platform } from "react-native"; +import { Animated, Text, StyleSheet, Platform } from "react-native"; import { useSignIn } from "@clerk/expo"; import { useRouter } from "expo-router"; import { useTranslation } from "react-i18next"; import { Button } from "../../src/components/Button"; -import { TextField } from "../../src/components/TextField"; -import { PasswordField } from "../../src/components/PasswordField"; -import { LanguageSwitcher } from "../../src/components/LanguageSwitcher"; +import { KeyRound, Lock, Mail } from "lucide-react-native"; import { GoogleSignInButton } from "../../src/components/GoogleSignInButton"; import { AppleSignInButton } from "../../src/components/AppleSignInButton"; +import { AuthDivider, AuthFooterLink, AuthShell } from "../../src/components/auth/AuthShell"; +import { AuthField } from "../../src/components/auth/AuthField"; +import { Reveal } from "../../src/components/auth/Reveal"; +import { useShake } from "../../src/hooks/useShake"; import { useTheme } from "../../src/context/ThemeContext"; import { getTypography, type ColorTokens, type Typography } from "../../src/theme/tokens"; @@ -35,6 +37,9 @@ export default function SignInScreen() { const [code, setCode] = useState(""); const [step, setStep] = useState<"credentials" | "verify-device">("credentials"); const [error, setError] = useState(null); + const [isCredentialError, setIsCredentialError] = useState(false); + const { shakeStyle, shake } = useShake(); + const isBusy = fetchStatus === "fetching"; const finalizeIfComplete = async () => { if (signIn.status !== "complete") { @@ -50,6 +55,8 @@ export default function SignInScreen() { const { error: signInError } = await signIn.password({ identifier: emailAddress, password }); if (signInError) { setError(signInError.longMessage ?? signInError.message); + setIsCredentialError(true); + shake(); return; } @@ -71,6 +78,7 @@ export default function SignInScreen() { const { error: verifyError } = await signIn.mfa.verifyEmailCode({ code }); if (verifyError) { setError(verifyError.longMessage ?? verifyError.message); + shake(); return; } await finalizeIfComplete(); @@ -78,89 +86,110 @@ export default function SignInScreen() { if (step === "verify-device") { return ( - - - - {t("auth.verifyDeviceTitle")} - {t("auth.verifyDeviceHint", { email: emailAddress })} - - {error ? {error} : null} -