-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
98 lines (91 loc) · 2.1 KB
/
App.js
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from "react";
import { Text, View, StyleSheet, TextInput, Button, Platform } from "react-native";
import passwords from "passwords"; //previously used passwords
export default class Test extends React.Component {
constructor(props) {
super(props);
this.state = {
newPassword: {
text: "",
valid: false
},
confirmPassword: {
text: "",
valid: false
},
buttonDisabled: true
};
}
_isValidPassword = () => false;
_onChangeEnterNewPassword = value => {
this.setState({
newPassword: {
text: value,
valid: this._isValidPassword()
}
});
};
_onChangeConfirmNewPassword = value => {
this.setState({
confirmPassword: {
text: value,
valid: this._isValidPassword()
}
});
};
render() {
return (
<View style={styles.container}>
<Text style={styles.textLabel}>Enter new password: </Text>
<TextInput
style={styles.textInput}
onChangeText={this._onChangeEnterNewPassword}
value={this.state.text}
/>
<Text style={styles.textLabel}>Confirm new password: </Text>
<TextInput
style={styles.textInput}
onChangeText={this._onChangeConfirmNewPassword}
value={this.state.text}
/>
<View style={{ backgroundColor: "green", marginTop: 20 }}>
<Button
disabled={this.state.buttonDisabled}
title="Reset Password"
color="#ffffff"
onPress={() => {}}
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-start",
padding: 10,
backgroundColor: "#F5FCFF"
},
textLabel: {
textAlign: "left",
marginTop: 20
},
textInput: Platform.select({
ios: {
width: "100%",
fontSize: 20,
height: 30,
borderWidth: 1
},
android: {
width: "100%",
height: 40
}
})
});