@boneframework/native-components 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/screens/SetPasswordScreen.js +64 -0
package/package.json
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {Keyboard, StyleSheet, View} from "react-native";
|
|
3
|
+
import * as Yup from "yup";
|
|
4
|
+
|
|
5
|
+
import {ErrorMessage, Form, FormField, SubmitButton} from "../components/forms";
|
|
6
|
+
import Image from "../components/Image";
|
|
7
|
+
|
|
8
|
+
import settings from "../../../../config/settings";
|
|
9
|
+
|
|
10
|
+
const validationSchema = Yup.object().shape({
|
|
11
|
+
password: Yup.string().required().min(4).label('Password'),
|
|
12
|
+
confirm: Yup.string().required().oneOf([Yup.ref('password'), null], 'Passwords must match').label('Confirm')
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function SetPasswordScreen({submitCallback, error}) {
|
|
16
|
+
|
|
17
|
+
return(
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<Image style={styles.logo} source={require('../../../../assets/logo.png')} />
|
|
20
|
+
<Form
|
|
21
|
+
initialValues={{ password: '', confirm: ''}}
|
|
22
|
+
onSubmit={submitCallback}
|
|
23
|
+
validationSchema={validationSchema}
|
|
24
|
+
>
|
|
25
|
+
<ErrorMessage error={error} visible={error} />
|
|
26
|
+
<FormField
|
|
27
|
+
name="password"
|
|
28
|
+
autoCaptitalize="none"
|
|
29
|
+
autoCorrect={false}
|
|
30
|
+
icon="lock"
|
|
31
|
+
placeholder="Password"
|
|
32
|
+
secureTextEntry
|
|
33
|
+
textContentType="password"
|
|
34
|
+
/>
|
|
35
|
+
<FormField
|
|
36
|
+
name="confirm"
|
|
37
|
+
autoCaptitalize="none"
|
|
38
|
+
autoCorrect={false}
|
|
39
|
+
icon="lock"
|
|
40
|
+
placeholder="Confirm password"
|
|
41
|
+
secureTextEntry
|
|
42
|
+
textContentType="password"
|
|
43
|
+
/>
|
|
44
|
+
<SubmitButton color="primary" title="Set Password" />
|
|
45
|
+
</Form>
|
|
46
|
+
</View>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
container: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
paddingHorizontal: 20
|
|
54
|
+
},
|
|
55
|
+
logo: {
|
|
56
|
+
width: 150,
|
|
57
|
+
height: 105,
|
|
58
|
+
alignSelf: "center",
|
|
59
|
+
marginTop: 50,
|
|
60
|
+
marginBottom: 20,
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
export default SetPasswordScreen;
|