-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
110 lines (100 loc) · 2.68 KB
/
App.tsx
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import React, { Component } from 'react';
import { View, TextInput, Button, KeyboardAvoidingView, StyleSheet } from 'react-native';
class App extends Component {
state = {
username: '',
password: '',
phone:'',
email:'',
address:''
};
handleUsernameChange = (username) => {
this.setState({ username });
};
handlePasswordChange = (password) => {
this.setState({ password });
};
handleEmailChange = (email) => {
this.setState({ email });
};
handleAddressChange = (address) => {
this.setState({ address });
};
handlePhoneChange = (phone) => {
this.setState({ phone });
};
handleLogin = () => {
const { username, password,email,phone,address } = this.state;
// Add your login logic here
console.log('Username:', username);
console.log('Password:', password);
console.log('Email:', email);
console.log('Phone:', phone);
console.log('Address:', address);
};
render() {
return (
<KeyboardAvoidingView style={styles.container} behavior="padding">
<View style={styles.inputContainer}>
<TextInput
style={styles.input}
placeholder="Username"
onChangeText={this.handleUsernameChange}
value={this.state.username}
autoCapitalize="none"
/>
<TextInput
style={styles.input}
placeholder="Email"
onChangeText={this.handleEmailChange}
value={this.state.email}
autoCapitalize="none"
/>
<TextInput
style={styles.input}
placeholder="Phone"
onChangeText={this.handlePhoneChange}
value={this.state.phone}
autoCapitalize="none"
/>
<TextInput
style={styles.input}
placeholder="Address"
onChangeText={this.handleAddressChange}
value={this.state.address}
returnKeyType='done'
secureTextEntry
/>
<TextInput
style={styles.input}
placeholder="Password"
onChangeText={this.handlePasswordChange}
value={this.state.password}
returnKeyType='done'
secureTextEntry
/>
<Button title="Login" onPress={this.handleLogin} />
</View>
</KeyboardAvoidingView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff',
},
inputContainer: {
width: '80%',
},
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
marginBottom: 20,
paddingLeft: 10,
},
});
export default App;