-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignup.js
More file actions
109 lines (94 loc) · 2.78 KB
/
Signup.js
File metadata and controls
109 lines (94 loc) · 2.78 KB
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
import {createStackNavigator, createAppContainer} from 'react-navigation';
import { StyleSheet,View,Button,Text,TouchableOpacity,Image } from 'react-native';
import React, { Component } from 'react';
import { TextInput } from 'react-native-gesture-handler';
export default class Signup extends React.Component {
constructor() {
super()
this.state = {
username: "",
password: "",
confrimpassword:"",
email:""
}
}
handleUserName = (newtext) => {
this.setState({
username: newtext
})
}
handleEmail=(newtext)=>{
this.setState({
email: newtext
})
}
handlepassword=(newtext)=>{
this.setState({
password: newtext
})
}
handleconfrimpassword=(newtext)=>{
this.setState({
confrimpassword: newtext
})
}
handleAll=()=>{
if(this.state.password === this.state.confrimpassword)
{
this.props.navigation.navigate('Home', { name: 'abdullah' })
Alert.alert('Login success')
}
else{
Alert.alert('password do not match')
}
}
static navigationOptions = {
title: 'SignUp',
headerStyle: {
backgroundColor: 'red',
textAlign: 'center',
},
alignSelf: 'center',
headerTitleStyle: {
fontWeight: 'bold',
fontWeight: '300',
textAlign: 'center',
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
marginRight:70,
flex: 1
},
};
render() {
const {navigate} = this.props.navigation;
return (
<View style={styles.container}>
<TextInput style={styles.inputtext} placeholder="Your Name"
underlineColorAndroid={'transparent'} onChangeText={()=>{this.handleUserName}}/>
<TextInput style={styles.inputtext} placeholder="Your email"
underlineColorAndroid={'transparent'} onChangeText={()=>{this.handleEmail}}/>
<TextInput style={styles.inputtext} placeholder="Your password"
underlineColorAndroid={'transparent'} secureTextEntry={true} onChangeText={()=>{this.handlepassword}}/>
<TextInput style={styles.inputtext} placeholder="Your password"
underlineColorAndroid={'transparent'} secureTextEntry={true} onChangeText={()=>{this.handleconfrimpassword}}/>
<Button onpress={()=>{this.handleAll}} title="SignUp"/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 50,
},
inputtext:{
alignSelf:'stretch',
height: 40,
paddingBottom:10,
marginBottom:30,
color:'black',
borderBottomColor:'#f8f8f8',
borderBottomWidth:1,
},
} )