From b56a96f0ff676b635e3e8dbfe12c72c2477a1d6b Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Thu, 3 Jul 2025 20:56:50 +0500 Subject: [PATCH] amazing design --- src/components/Input.js | 9 +- src/navigation/AuthNavigator.js | 3 +- src/screens/Auth/LoginScreen.js | 103 +++++++++-------- src/screens/Auth/RegisterScreen.js | 147 ++++++++++++++----------- src/screens/Auth/VerificationScreen.js | 119 ++++++++++++-------- 5 files changed, 225 insertions(+), 156 deletions(-) diff --git a/src/components/Input.js b/src/components/Input.js index c949ca0..fc75bab 100644 --- a/src/components/Input.js +++ b/src/components/Input.js @@ -1,9 +1,9 @@ -import React, { useState } from 'react'; +import React, { useState, forwardRef } from 'react'; import { View, TextInput, Text, StyleSheet, TouchableOpacity } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { COLORS } from '../constants/colors'; -const Input = ({ +const Input = forwardRef(({ label, value, onChangeText, @@ -17,7 +17,7 @@ const Input = ({ returnKeyType = 'done', onSubmitEditing, ...props -}) => { +}, ref) => { const [isPasswordVisible, setIsPasswordVisible] = useState(false); const [isFocused, setIsFocused] = useState(false); @@ -40,6 +40,7 @@ const Input = ({ )} {error}} ); -}; +}); const styles = StyleSheet.create({ container: { diff --git a/src/navigation/AuthNavigator.js b/src/navigation/AuthNavigator.js index 82162b4..b4654da 100644 --- a/src/navigation/AuthNavigator.js +++ b/src/navigation/AuthNavigator.js @@ -15,6 +15,7 @@ const AuthNavigator = () => { { return { cardStyle: { @@ -30,7 +31,7 @@ const AuthNavigator = () => { }; }, }} - initialRouteName={pendingVerification ? 'Verification' : 'Login'} + initialRouteName={pendingVerification?.phone ? 'Verification' : 'Login'} > diff --git a/src/screens/Auth/LoginScreen.js b/src/screens/Auth/LoginScreen.js index 6de079a..fc689c6 100644 --- a/src/screens/Auth/LoginScreen.js +++ b/src/screens/Auth/LoginScreen.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useRef } from 'react'; import { View, Text, @@ -24,6 +24,7 @@ const LoginScreen = ({ navigation }) => { const [password, setPassword] = useState(''); const [errors, setErrors] = useState({}); const { login, isLoading } = useAuth(); + const passwordInputRef = useRef(null); const validateForm = () => { const newErrors = {}; @@ -76,56 +77,65 @@ const LoginScreen = ({ navigation }) => { showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled" > - - - TBBANK ONLINE - Hoş geldiňiz - + + + + + TBBANK ONLINE + Hoş geldiňiz + - - Giriş - - Hasabyňyza girmek üçin maglumatyňyzy giriziň - + + Giriş + + Hasabyňyza girmek üçin maglumatyňyzy giriziň + - + passwordInputRef.current?.focus()} + /> - + -