import { StyleSheet, Image, Text, View, StatusBar, KeyboardAvoidingView, ScrollView, } from "react-native"; import React, { useState } from "react"; import { colors, network } from "../../constants"; import CustomInput from "../../components/CustomInput"; import header_logo from "../../assets/logo/logo.png"; import CustomButton from "../../components/CustomButton"; import CustomAlert from "../../components/CustomAlert/CustomAlert"; import ProgressDialog from "react-native-progress-dialog"; import InternetConnectionAlert from "react-native-internet-connection-alert"; import AsyncStorage from "@react-native-async-storage/async-storage"; const LoginScreen = ({ navigation }) => { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [isloading, setIsloading] = useState(false); // Örnek bir kullanıcı nesnesi: const user = { name: "Yasin Soysal", email: "info@yasinsoysal.com", password: "123456", // Diğer kullanıcı bilgileri... }; // Örnek bir oturum açma işlemi: const login = () => { // Kullanıcı oturum açma işlemini gerçekleştirir. // Örneğin, kullanıcı adı ve şifre doğrulaması yapar veya başka bir kimlik doğrulama yöntemi kullanır. // Başarılı oturum açma işlemi sonrasında kullanıcıyı uygulamaya yönlendirir. // Örnek olarak, kullanıcıyı uygulama ana sayfasına yönlendirebilirsiniz: navigation.replace("tab", { user }); }; //method to validate the user credentials and navigate to Home Screen / Dashboard const loginHandle = () => { setIsloading(true); //[check validation] -- Start // if email does not contain @ sign if (email == "") { setIsloading(false); return setError("Lütfen E-posta Adresinizi Giriniz"); } if (password == "") { setIsloading(false); return setError("Lütfen şifrenizi giriniz"); } if (!email.includes("@")) { setIsloading(false); return setError("Eposta adresi doğru değil"); } // length of email must be greater than 5 characters if (email.length < 6) { setIsloading(false); return setError("Eposta adresi çok kısa"); } // length of password must be greater than 5 characters if (password.length < 6) { setIsloading(false); return setError("Şifre 6 karakterden uzun olmalıdır"); } //[check validation] -- End }; return ( {}}> BEGO 130 Yıllık Alman Geleneği Giriş navigation.navigate("forgetpassword")} style={styles.ForgetText} > Şifremi Unuttum? Hesabınız yok mu? navigation.navigate("signup")} style={styles.signupText} > Kayıt Ol ); }; export default LoginScreen; const styles = StyleSheet.create({ container: { width: "100%", flexDirecion: "row", backgroundColor: colors.light, alignItems: "center", justifyContent: "center", padding: 20, flex: 1, }, welconeContainer: { width: "100%", display: "flex", flexDirection: "row", justifyContent: "space-around", alignItems: "center", height: "30%", // padding:15 }, formContainer: { flex: 3, justifyContent: "flex-start", alignItems: "center", display: "flex", width: "100%", flexDirecion: "row", padding: 5, }, logo: { resizeMode: "contain", width: 80, }, welcomeText: { fontSize: 42, fontWeight: "bold", color: colors.muted, }, welcomeParagraph: { fontSize: 15, fontWeight: "500", color: colors.primary_shadow, }, forgetPasswordContainer: { marginTop: 10, width: "100%", display: "flex", flexDirection: "row", justifyContent: "flex-end", alignItems: "center", }, ForgetText: { fontSize: 15, fontWeight: "600", }, buttomContainer: { display: "flex", justifyContent: "center", width: "100%", }, bottomContainer: { marginTop: 10, display: "flex", flexDirection: "row", justifyContent: "center", }, signupText: { marginLeft: 2, color: colors.primary, fontSize: 15, fontWeight: "600", }, screenNameContainer: { marginTop: 10, width: "100%", display: "flex", flexDirection: "row", justifyContent: "flex-start", alignItems: "center", }, screenNameText: { fontSize: 30, fontWeight: "800", color: colors.muted, }, });