1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
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;
|