From b248e5578f80bed82fbdac8346b4bc89173ba598 Mon Sep 17 00:00:00 2001 From: Jaanu423 Date: Fri, 26 Sep 2025 18:13:59 +0530 Subject: [PATCH] themed style --- src/screens/LoginScreen.tsx | 154 ++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/src/screens/LoginScreen.tsx b/src/screens/LoginScreen.tsx index 12979a9..3f00e4b 100644 --- a/src/screens/LoginScreen.tsx +++ b/src/screens/LoginScreen.tsx @@ -19,7 +19,6 @@ import type { StackNavigationProp } from "@react-navigation/stack"; import { RootStackParamList } from "../navigation/AppNavigator"; import { CustomButton, CustomInput } from "../components/common/Custom"; import colors from "../components/colors"; -import AnimatedText from "../components/common/AnimatedText"; const theme = { primary: "#111111", @@ -50,91 +49,90 @@ export default function LoginScreen() { ]).start(); }, []); - const handleContinue = async () => { - if (mobile.length === 10) { - setLoading(true); - try { - const res = await axios.get(LOGIN_URL, { - params: { mobile }, - }); + const handleContinue = async () => { + if (mobile.length === 10) { + setLoading(true); + try { + const res = await axios.get(LOGIN_URL, { + params: { mobile }, + }); - console.log("OTP sent response:", res.data); + console.log("OTP sent response:", res.data); - if (res.data.statusCode === 200) { - navigation.navigate("OtpVarify", { mobile }); - } else { - Alert.alert("Error", res.data.message || "Failed to send OTP"); + if (res.data.statusCode === 200) { + navigation.navigate("OtpVarify", { mobile }); + } else { + Alert.alert("Error", res.data.message || "Failed to send OTP"); + } + } catch (error: any) { + console.error("Login error:", error); + + if (axios.isAxiosError(error)) { + console.log("Error message:", error.message); + console.log("Error response:", error.response?.data); + console.log("Error status:", error.response?.status); + console.log("Error headers:", error.response?.headers); + } else { + console.log("Unexpected error:", error); + } + + Alert.alert("Error", "Failed to send OTP. Please try again."); + } finally { + setLoading(false); } - } catch (error: any) { - console.error("Login error:", error); - - if (axios.isAxiosError(error)) { - console.log("Error message:", error.message); - console.log("Error response:", error.response?.data); - console.log("Error status:", error.response?.status); - console.log("Error headers:", error.response?.headers); - } else { - console.log("Unexpected error:", error); - } - - Alert.alert("Error", "Failed to send OTP. Please try again."); - } finally { - setLoading(false); + } else { + Alert.alert("Please enter a valid 10-digit mobile number"); } - } else { - Alert.alert("Please enter a valid 10-digit mobile number"); - } -}; + }; -return ( - - - - {/* Top content */} - - {/* */} - CircleCollect - Welcome Back 👋 - - Enter your mobile number to sign in and continue. - - - - - - - - {/* Bottom Button */} - - + - - By continuing, you agree to our{" "} - - Terms & Privacy + {/* Top content */} + + CircleCollect + Welcome Back 👋 + + Enter your mobile number to sign in and continue. - - - -); + + + + + + + {/* Bottom Button */} + + + + + By continuing, you agree to our{" "} + + Terms & Privacy + + + + + ); } const styles = StyleSheet.create({