aboutsummaryrefslogblamecommitdiffstats
path: root/src/screens/Auth/LoginScreen.js
blob: c74fed40e315e6ca5094d0a7a3e7068fca8916ba (plain) (tree)
1
2
3
4
5
6
                                        
                                                                                



                                               








                                                 

    
                                      
                                                 

                                             

    





                                                 
          
















                                             
                                                    


                                                                          
                                                          
             



           

























                                    
                           
 
import React, { useState } from 'react';
import { View, Text, TextInput, Button, StyleSheet, Alert } from 'react-native';

const LoginScreen = ({ navigation }) => {
  const [email, setEmail] = useState('');
  const [password, setPassword] = useState('');

  const handleLogin = () => {
    // Handle login logic here
    Alert.alert("Login", "Login button pressed");
  };

  const handleRegister = () => {
    // Navigate to the Signup screen
    navigation.navigate('Signup'); 
  };

  const handleForgotPassword = () => {
    console.log("Navigating to Forgot Password");
    // Navigate to the forgot password screen
    navigation.navigate('ForgotPassword');
  };

  const handleTesting = () => {
    console.log("Navigating to Forgot Password");
    // Navigate to the forgot password screen
    navigation.navigate('MallSelection');
  };

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Login</Text>
      <TextInput
        style={styles.input}
        placeholder="Email"
        value={email}
        onChangeText={setEmail}
        keyboardType="email-address"
        autoCapitalize="none"
      />
      <TextInput
        style={styles.input}
        placeholder="Password"
        value={password}
        onChangeText={setPassword}
        secureTextEntry
      />
      <Button title="Login" onPress={handleLogin} />
      <View style={styles.buttonContainer}>
        <Button title="Register" onPress={handleRegister} />
        <Button title="Forgot Password?" onPress={handleForgotPassword} />
        <Button title="Testing" onPress={handleTesting} />
      </View>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: 16,
  },
  title: {
    fontSize: 24,
    fontWeight: 'bold',
    marginBottom: 24,
    textAlign: 'center',
  },
  input: {
    height: 40,
    borderColor: '#ccc',
    borderWidth: 1,
    marginBottom: 12,
    paddingHorizontal: 8,
  },
  buttonContainer: {
    marginTop: 12,
    flexDirection: 'row',
    justifyContent: 'space-between',
  },
});

export default LoginScreen;