@kiosinc/commons-rn 0.1.18 → 0.1.20
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/lib/commonjs/auth/screens/LoginScreen.js +4 -8
- package/lib/commonjs/auth/screens/LoginScreen.js.map +1 -1
- package/lib/commonjs/auth/screens/ResetPassword.js +4 -2
- package/lib/commonjs/auth/screens/ResetPassword.js.map +1 -1
- package/lib/commonjs/auth/screens/SignUp.js +4 -1
- package/lib/commonjs/auth/screens/SignUp.js.map +1 -1
- package/lib/commonjs/auth/screens/SignUpPassword.js +4 -1
- package/lib/commonjs/auth/screens/SignUpPassword.js.map +1 -1
- package/lib/commonjs/auth/screens/VerifyPhoneNumber.js +4 -1
- package/lib/commonjs/auth/screens/VerifyPhoneNumber.js.map +1 -1
- package/lib/commonjs/components/Alert.js +11 -1
- package/lib/commonjs/components/Alert.js.map +1 -1
- package/lib/commonjs/components/Snackbar.js +9 -0
- package/lib/commonjs/components/Snackbar.js.map +1 -1
- package/lib/commonjs/components/TextInput.js +4 -2
- package/lib/commonjs/components/TextInput.js.map +1 -1
- package/lib/module/auth/screens/LoginScreen.js +5 -9
- package/lib/module/auth/screens/LoginScreen.js.map +1 -1
- package/lib/module/auth/screens/ResetPassword.js +5 -3
- package/lib/module/auth/screens/ResetPassword.js.map +1 -1
- package/lib/module/auth/screens/SignUp.js +5 -2
- package/lib/module/auth/screens/SignUp.js.map +1 -1
- package/lib/module/auth/screens/SignUpPassword.js +5 -2
- package/lib/module/auth/screens/SignUpPassword.js.map +1 -1
- package/lib/module/auth/screens/VerifyPhoneNumber.js +5 -2
- package/lib/module/auth/screens/VerifyPhoneNumber.js.map +1 -1
- package/lib/module/components/Alert.js +12 -1
- package/lib/module/components/Alert.js.map +1 -1
- package/lib/module/components/Snackbar.js +9 -0
- package/lib/module/components/Snackbar.js.map +1 -1
- package/lib/module/components/TextInput.js +4 -2
- package/lib/module/components/TextInput.js.map +1 -1
- package/lib/typescript/src/auth/screens/LoginScreen.d.ts.map +1 -1
- package/lib/typescript/src/auth/screens/ResetPassword.d.ts.map +1 -1
- package/lib/typescript/src/auth/screens/SignUp.d.ts.map +1 -1
- package/lib/typescript/src/auth/screens/SignUpPassword.d.ts.map +1 -1
- package/lib/typescript/src/auth/screens/VerifyPhoneNumber.d.ts.map +1 -1
- package/lib/typescript/src/components/Alert.d.ts.map +1 -1
- package/lib/typescript/src/components/Snackbar.d.ts.map +1 -1
- package/lib/typescript/src/components/TextInput.d.ts +1 -0
- package/lib/typescript/src/components/TextInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/auth/screens/LoginScreen.tsx +85 -91
- package/src/auth/screens/ResetPassword.tsx +46 -42
- package/src/auth/screens/SignUp.tsx +105 -101
- package/src/auth/screens/SignUpPassword.tsx +68 -64
- package/src/auth/screens/VerifyPhoneNumber.tsx +55 -51
- package/src/components/Alert.tsx +14 -3
- package/src/components/Snackbar.tsx +6 -0
- package/src/components/TextInput.tsx +11 -6
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
TextInput,
|
|
6
6
|
Button,
|
|
7
7
|
KeyboardAvoidingView,
|
|
8
|
+
Header,
|
|
8
9
|
} from '../../components';
|
|
9
10
|
import { type NavigationProp, useNavigation } from '@react-navigation/native';
|
|
10
11
|
import React from 'react';
|
|
@@ -40,49 +41,52 @@ export const ResetPasswordScreen = () => {
|
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
|
-
<ParentView
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<Text py="48" textAlign="center" variant="titleLarge">
|
|
51
|
-
{t('authentication.enterYour')}
|
|
52
|
-
</Text>
|
|
53
|
-
</View>
|
|
54
|
-
<Controller
|
|
55
|
-
control={control}
|
|
56
|
-
render={({ field: { onChange, onBlur, value } }) => {
|
|
57
|
-
return (
|
|
58
|
-
<TextInput
|
|
59
|
-
keyboardType="email-address"
|
|
60
|
-
autoCapitalize="none"
|
|
61
|
-
mode="outlined"
|
|
62
|
-
autoComplete="email"
|
|
63
|
-
error={!!errors.email?.message}
|
|
64
|
-
errorMessage={errors.email?.message}
|
|
65
|
-
onBlur={onBlur}
|
|
66
|
-
onChangeText={onChange}
|
|
67
|
-
value={value}
|
|
68
|
-
label={t('authentication.email')}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
}}
|
|
72
|
-
name="email"
|
|
73
|
-
/>
|
|
74
|
-
<Button
|
|
75
|
-
loading={isLoading}
|
|
76
|
-
mt="16"
|
|
77
|
-
mode="contained"
|
|
78
|
-
onPress={handleSubmit(onSubmit)}
|
|
44
|
+
<ParentView px="16">
|
|
45
|
+
<Header />
|
|
46
|
+
<View flex={1} justifyContent={'center'}>
|
|
47
|
+
<KeyboardAvoidingView
|
|
48
|
+
alignSelf="center"
|
|
49
|
+
justifyContent={'center'}
|
|
50
|
+
width={{ phone: '100%', tablet: 372 }}
|
|
79
51
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
<View alignItems="center">
|
|
53
|
+
<Text py="48" textAlign="center" variant="titleLarge">
|
|
54
|
+
{t('authentication.enterYour')}
|
|
55
|
+
</Text>
|
|
56
|
+
</View>
|
|
57
|
+
<Controller
|
|
58
|
+
control={control}
|
|
59
|
+
render={({ field: { onChange, onBlur, value } }) => {
|
|
60
|
+
return (
|
|
61
|
+
<TextInput
|
|
62
|
+
keyboardType="email-address"
|
|
63
|
+
autoCapitalize="none"
|
|
64
|
+
mode="outlined"
|
|
65
|
+
autoComplete="email"
|
|
66
|
+
error={!!errors.email?.message}
|
|
67
|
+
errorMessage={errors.email?.message}
|
|
68
|
+
onBlur={onBlur}
|
|
69
|
+
onChangeText={onChange}
|
|
70
|
+
value={value}
|
|
71
|
+
label={t('authentication.email')}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}}
|
|
75
|
+
name="email"
|
|
76
|
+
/>
|
|
77
|
+
<Button
|
|
78
|
+
loading={isLoading}
|
|
79
|
+
mt="16"
|
|
80
|
+
mode="contained"
|
|
81
|
+
onPress={handleSubmit(onSubmit)}
|
|
82
|
+
>
|
|
83
|
+
{t('authentication.resetPassword')}
|
|
84
|
+
</Button>
|
|
85
|
+
<Button mt="48" mode="outlined" onPress={navigation.goBack}>
|
|
86
|
+
{t('cancel')}
|
|
87
|
+
</Button>
|
|
88
|
+
</KeyboardAvoidingView>
|
|
89
|
+
</View>
|
|
86
90
|
</ParentView>
|
|
87
91
|
);
|
|
88
92
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Button,
|
|
7
7
|
LinkButton,
|
|
8
8
|
KeyboardAvoidingView,
|
|
9
|
+
Header,
|
|
9
10
|
} from '../../components';
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import { useTranslation } from 'react-i18next';
|
|
@@ -59,36 +60,19 @@ export const SignUpScreen = () => {
|
|
|
59
60
|
|
|
60
61
|
return (
|
|
61
62
|
<ParentView px="16" justifyContent="center">
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
render={({ field: { onChange, onBlur, value } }) => {
|
|
76
|
-
return (
|
|
77
|
-
<TextInput
|
|
78
|
-
my="5"
|
|
79
|
-
mode="outlined"
|
|
80
|
-
error={!!errors.displayName?.message}
|
|
81
|
-
errorMessage={errors.displayName?.message}
|
|
82
|
-
onBlur={onBlur}
|
|
83
|
-
onChangeText={onChange}
|
|
84
|
-
value={value}
|
|
85
|
-
label={t('authentication.displayName')}
|
|
86
|
-
/>
|
|
87
|
-
);
|
|
88
|
-
}}
|
|
89
|
-
name="displayName"
|
|
90
|
-
/>
|
|
91
|
-
{Config.APP_NAME !== 'gusteau' && (
|
|
63
|
+
<Header />
|
|
64
|
+
<View flex={1} justifyContent={'center'}>
|
|
65
|
+
<KeyboardAvoidingView
|
|
66
|
+
alignSelf="center"
|
|
67
|
+
justifyContent={'center'}
|
|
68
|
+
width={{ phone: '100%', tablet: 372 }}
|
|
69
|
+
>
|
|
70
|
+
<View alignItems="center">
|
|
71
|
+
<Text pb="40" variant="titleLarge">
|
|
72
|
+
{t('authentication.createAccountTitle')}
|
|
73
|
+
</Text>
|
|
74
|
+
</View>
|
|
75
|
+
<View justifyContent="center">
|
|
92
76
|
<Controller
|
|
93
77
|
control={control}
|
|
94
78
|
render={({ field: { onChange, onBlur, value } }) => {
|
|
@@ -96,85 +80,105 @@ export const SignUpScreen = () => {
|
|
|
96
80
|
<TextInput
|
|
97
81
|
my="5"
|
|
98
82
|
mode="outlined"
|
|
99
|
-
error={!!errors.
|
|
100
|
-
errorMessage={errors.
|
|
83
|
+
error={!!errors.displayName?.message}
|
|
84
|
+
errorMessage={errors.displayName?.message}
|
|
101
85
|
onBlur={onBlur}
|
|
102
86
|
onChangeText={onChange}
|
|
103
87
|
value={value}
|
|
104
|
-
label={t('authentication.
|
|
88
|
+
label={t('authentication.displayName')}
|
|
105
89
|
/>
|
|
106
90
|
);
|
|
107
91
|
}}
|
|
108
|
-
name="
|
|
92
|
+
name="displayName"
|
|
109
93
|
/>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
94
|
+
{Config.APP_NAME !== 'gusteau' && (
|
|
95
|
+
<Controller
|
|
96
|
+
control={control}
|
|
97
|
+
render={({ field: { onChange, onBlur, value } }) => {
|
|
98
|
+
return (
|
|
99
|
+
<TextInput
|
|
100
|
+
my="5"
|
|
101
|
+
mode="outlined"
|
|
102
|
+
error={!!errors.name?.message}
|
|
103
|
+
errorMessage={errors.name?.message}
|
|
104
|
+
onBlur={onBlur}
|
|
105
|
+
onChangeText={onChange}
|
|
106
|
+
value={value}
|
|
107
|
+
label={t('authentication.businessName')}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
}}
|
|
111
|
+
name="name"
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
114
|
+
<Controller
|
|
115
|
+
control={control}
|
|
116
|
+
render={({ field: { onChange, onBlur, value } }) => {
|
|
117
|
+
return (
|
|
118
|
+
<TextInput
|
|
119
|
+
my="5"
|
|
120
|
+
autoCapitalize="none"
|
|
121
|
+
keyboardType="email-address"
|
|
122
|
+
mode="outlined"
|
|
123
|
+
autoComplete="email"
|
|
124
|
+
error={!!errors.email?.message}
|
|
125
|
+
errorMessage={errors.email?.message}
|
|
126
|
+
onBlur={onBlur}
|
|
127
|
+
onChangeText={onChange}
|
|
128
|
+
value={value}
|
|
129
|
+
label={t('authentication.email')}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}}
|
|
133
|
+
name="email"
|
|
134
|
+
/>
|
|
135
|
+
<Controller
|
|
136
|
+
control={control}
|
|
137
|
+
render={({ field: { onChange, onBlur, value } }) => {
|
|
138
|
+
return (
|
|
139
|
+
<TextInput
|
|
140
|
+
my="5"
|
|
141
|
+
mode="outlined"
|
|
142
|
+
error={!!errors.phoneNumber?.message}
|
|
143
|
+
errorMessage={errors.phoneNumber?.message}
|
|
144
|
+
onBlur={onBlur}
|
|
145
|
+
onChangeText={onChange}
|
|
146
|
+
value={value}
|
|
147
|
+
label={t('authentication.phoneNumber')}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
}}
|
|
151
|
+
name="phoneNumber"
|
|
152
|
+
/>
|
|
153
|
+
</View>
|
|
154
|
+
<Button
|
|
155
|
+
loading={isCheckingIsRegistered}
|
|
156
|
+
mt="48"
|
|
157
|
+
onPress={handleSubmit(onSubmit)}
|
|
158
|
+
mode="contained"
|
|
173
159
|
>
|
|
174
|
-
{t('authentication.
|
|
175
|
-
</
|
|
176
|
-
|
|
177
|
-
|
|
160
|
+
{t('authentication.createAccount')}
|
|
161
|
+
</Button>
|
|
162
|
+
<View flexDirection="row" flexWrap="wrap" pt="10">
|
|
163
|
+
<Text>{t('authentication.byContinue')}</Text>
|
|
164
|
+
<LinkButton
|
|
165
|
+
labelStyle={style.termsAndConditions}
|
|
166
|
+
mode="text"
|
|
167
|
+
onPress={() => Linking.openURL(TERMS_OF_SERVICE)}
|
|
168
|
+
>
|
|
169
|
+
{t('authentication.termsAndConditions')}
|
|
170
|
+
</LinkButton>
|
|
171
|
+
<Text>{t('authentication.and')}</Text>
|
|
172
|
+
<LinkButton
|
|
173
|
+
labelStyle={style.privacyPolicy}
|
|
174
|
+
mode="text"
|
|
175
|
+
onPress={() => Linking.openURL(PRIVACY_POLICY)}
|
|
176
|
+
>
|
|
177
|
+
{t('authentication.privacyPolicy')}
|
|
178
|
+
</LinkButton>
|
|
179
|
+
</View>
|
|
180
|
+
</KeyboardAvoidingView>
|
|
181
|
+
</View>
|
|
178
182
|
</ParentView>
|
|
179
183
|
);
|
|
180
184
|
};
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Button,
|
|
6
6
|
KeyboardAvoidingView,
|
|
7
7
|
TextInput,
|
|
8
|
+
Header,
|
|
8
9
|
} from '../../components';
|
|
9
10
|
import type { RouteProp } from '@react-navigation/native';
|
|
10
11
|
import React from 'react';
|
|
@@ -57,72 +58,75 @@ export const SignUpPassword: React.FC<SignUpPasswordProps> = ({ route }) => {
|
|
|
57
58
|
|
|
58
59
|
return (
|
|
59
60
|
<ParentView justifyContent="center" px="16">
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
<Header />
|
|
62
|
+
<View flex={1} justifyContent={'center'}>
|
|
63
|
+
<KeyboardAvoidingView
|
|
64
|
+
alignSelf="center"
|
|
65
|
+
justifyContent={'center'}
|
|
66
|
+
width={{ phone: '100%', tablet: 372 }}
|
|
67
|
+
>
|
|
68
|
+
<View alignItems="center">
|
|
69
|
+
<Text textAlign="center" variant="titleLarge">
|
|
70
|
+
{t('authentication.createPassword')}
|
|
71
|
+
</Text>
|
|
72
|
+
</View>
|
|
73
|
+
<Controller
|
|
74
|
+
control={control}
|
|
75
|
+
render={({ field: { onChange, onBlur, value } }) => {
|
|
76
|
+
const passwordErrors = Object.values(
|
|
77
|
+
errors.password?.types ?? []
|
|
78
|
+
).flat();
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
80
|
+
return (
|
|
81
|
+
<View mt="48">
|
|
82
|
+
<TextInput
|
|
83
|
+
error={!!errors.password?.message}
|
|
84
|
+
my="5"
|
|
85
|
+
secureTextEntry={true}
|
|
86
|
+
mode="outlined"
|
|
87
|
+
autoComplete="new-password"
|
|
88
|
+
onBlur={onBlur}
|
|
89
|
+
onChangeText={onChange}
|
|
90
|
+
value={value}
|
|
91
|
+
label={t('authentication.password')}
|
|
92
|
+
/>
|
|
93
|
+
<Text pt="4">{t('authentication.passwordMustContain')}</Text>
|
|
94
|
+
{passwordExpectations.map((expectation, index) => {
|
|
95
|
+
const didExpectationFoundInErrors =
|
|
96
|
+
passwordErrors?.includes(expectation) ?? false;
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
98
|
+
return (
|
|
99
|
+
<View flexDirection="row" alignItems="center" key={index}>
|
|
100
|
+
<Text
|
|
101
|
+
variant="bodySmall"
|
|
102
|
+
color={
|
|
103
|
+
isSubmitted
|
|
104
|
+
? didExpectationFoundInErrors
|
|
105
|
+
? 'error'
|
|
106
|
+
: 'primary'
|
|
107
|
+
: 'onBackground'
|
|
108
|
+
}
|
|
109
|
+
>
|
|
110
|
+
{'• ' + expectation}
|
|
111
|
+
</Text>
|
|
112
|
+
</View>
|
|
113
|
+
);
|
|
114
|
+
})}
|
|
115
|
+
</View>
|
|
116
|
+
);
|
|
117
|
+
}}
|
|
118
|
+
name="password"
|
|
119
|
+
/>
|
|
120
|
+
<Button
|
|
121
|
+
mt="48"
|
|
122
|
+
loading={isVerifyingPhoneNumber}
|
|
123
|
+
mode="contained"
|
|
124
|
+
onPress={handleSubmit(onSubmit)}
|
|
125
|
+
>
|
|
126
|
+
{t('continue')}
|
|
127
|
+
</Button>
|
|
128
|
+
</KeyboardAvoidingView>
|
|
129
|
+
</View>
|
|
126
130
|
</ParentView>
|
|
127
131
|
);
|
|
128
132
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
LinkButton,
|
|
7
7
|
OtpInputs,
|
|
8
8
|
KeyboardAvoidingView,
|
|
9
|
+
Header,
|
|
9
10
|
} from '../../components';
|
|
10
11
|
import type { RouteProp } from '@react-navigation/native';
|
|
11
12
|
import React from 'react';
|
|
@@ -47,58 +48,61 @@ export const VerifyPhoneNumberScreen: React.FC<
|
|
|
47
48
|
|
|
48
49
|
return (
|
|
49
50
|
<ParentView justifyContent="center" px="16">
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<Text pb="8" textAlign="center" variant="titleLarge">
|
|
57
|
-
{t('authentication.verifyYourNumber')}
|
|
58
|
-
</Text>
|
|
59
|
-
<Text
|
|
60
|
-
color="onSurfaceVariant"
|
|
61
|
-
pb="48"
|
|
62
|
-
textAlign="center"
|
|
63
|
-
variant="bodyLarge"
|
|
64
|
-
>
|
|
65
|
-
{t('authentication.codeSent')}
|
|
66
|
-
</Text>
|
|
67
|
-
</View>
|
|
68
|
-
<Controller
|
|
69
|
-
control={control}
|
|
70
|
-
render={({ field: { onChange, value } }) => {
|
|
71
|
-
return (
|
|
72
|
-
<OtpInputs
|
|
73
|
-
handleChange={onChange}
|
|
74
|
-
code={value}
|
|
75
|
-
numberOfInputs={6}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
}}
|
|
79
|
-
name="code"
|
|
80
|
-
/>
|
|
81
|
-
<Button
|
|
82
|
-
mt="48"
|
|
83
|
-
disabled={isResendingCode || isSigningUp}
|
|
84
|
-
loading={isSigningUp}
|
|
85
|
-
mode="contained"
|
|
86
|
-
onPress={handleSubmit(onSubmit)}
|
|
87
|
-
>
|
|
88
|
-
{t('continue')}
|
|
89
|
-
</Button>
|
|
90
|
-
<LinkButton
|
|
91
|
-
disabled={isResendingCode || isSigningUp}
|
|
92
|
-
loading={isResendingCode}
|
|
93
|
-
mt="48"
|
|
94
|
-
mode="text"
|
|
95
|
-
onPress={() => {
|
|
96
|
-
resendCode(params as any);
|
|
97
|
-
}}
|
|
51
|
+
<Header />
|
|
52
|
+
<View flex={1} justifyContent={'center'}>
|
|
53
|
+
<KeyboardAvoidingView
|
|
54
|
+
alignSelf="center"
|
|
55
|
+
justifyContent={'center'}
|
|
56
|
+
width={{ phone: '100%', tablet: 372 }}
|
|
98
57
|
>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
58
|
+
<View alignItems="center">
|
|
59
|
+
<Text pb="8" textAlign="center" variant="titleLarge">
|
|
60
|
+
{t('authentication.verifyYourNumber')}
|
|
61
|
+
</Text>
|
|
62
|
+
<Text
|
|
63
|
+
color="onSurfaceVariant"
|
|
64
|
+
pb="48"
|
|
65
|
+
textAlign="center"
|
|
66
|
+
variant="bodyLarge"
|
|
67
|
+
>
|
|
68
|
+
{t('authentication.codeSent')}
|
|
69
|
+
</Text>
|
|
70
|
+
</View>
|
|
71
|
+
<Controller
|
|
72
|
+
control={control}
|
|
73
|
+
render={({ field: { onChange, value } }) => {
|
|
74
|
+
return (
|
|
75
|
+
<OtpInputs
|
|
76
|
+
handleChange={onChange}
|
|
77
|
+
code={value}
|
|
78
|
+
numberOfInputs={6}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}}
|
|
82
|
+
name="code"
|
|
83
|
+
/>
|
|
84
|
+
<Button
|
|
85
|
+
mt="48"
|
|
86
|
+
disabled={isResendingCode || isSigningUp}
|
|
87
|
+
loading={isSigningUp}
|
|
88
|
+
mode="contained"
|
|
89
|
+
onPress={handleSubmit(onSubmit)}
|
|
90
|
+
>
|
|
91
|
+
{t('continue')}
|
|
92
|
+
</Button>
|
|
93
|
+
<LinkButton
|
|
94
|
+
disabled={isResendingCode || isSigningUp}
|
|
95
|
+
loading={isResendingCode}
|
|
96
|
+
mt="48"
|
|
97
|
+
mode="text"
|
|
98
|
+
onPress={() => {
|
|
99
|
+
resendCode(params as any);
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{t('authentication.resendCode')}
|
|
103
|
+
</LinkButton>
|
|
104
|
+
</KeyboardAvoidingView>
|
|
105
|
+
</View>
|
|
102
106
|
</ParentView>
|
|
103
107
|
);
|
|
104
108
|
};
|
package/src/components/Alert.tsx
CHANGED
|
@@ -2,6 +2,9 @@ import React, { useState, useCallback } from 'react';
|
|
|
2
2
|
import { Dialog, Text, useTheme } from 'react-native-paper';
|
|
3
3
|
import { t } from 'i18next';
|
|
4
4
|
import { Button } from './Button';
|
|
5
|
+
import type { PlatformIOSStatic } from 'react-native';
|
|
6
|
+
import { Platform } from 'react-native';
|
|
7
|
+
import { StyleSheet } from 'react-native';
|
|
5
8
|
|
|
6
9
|
interface ButtonProps {
|
|
7
10
|
label: string;
|
|
@@ -85,9 +88,13 @@ export const Alert = () => {
|
|
|
85
88
|
|
|
86
89
|
return (
|
|
87
90
|
<Dialog
|
|
88
|
-
style={
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
style={
|
|
92
|
+
(Platform as PlatformIOSStatic).isPad
|
|
93
|
+
? [styles.iPad, { backgroundColor: theme.colors.background }]
|
|
94
|
+
: {
|
|
95
|
+
backgroundColor: theme.colors.background,
|
|
96
|
+
}
|
|
97
|
+
}
|
|
91
98
|
dismissable={isDismissable}
|
|
92
99
|
dismissableBackButton={isDismissable}
|
|
93
100
|
onDismiss={() => {
|
|
@@ -155,3 +162,7 @@ Alert.displayName = 'Alert';
|
|
|
155
162
|
Alert.show = (params: AlertParams) => {
|
|
156
163
|
rootLevelRef?.show(params);
|
|
157
164
|
};
|
|
165
|
+
|
|
166
|
+
const styles = StyleSheet.create({
|
|
167
|
+
iPad: { zIndex: 100, width: '30%', alignSelf: 'center' },
|
|
168
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Platform, type PlatformIOSStatic, StyleSheet } from 'react-native';
|
|
3
4
|
import { Snackbar as PSnackbar } from 'react-native-paper';
|
|
4
5
|
|
|
5
6
|
interface SnackbarParams {
|
|
@@ -61,6 +62,7 @@ export const Snackbar = () => {
|
|
|
61
62
|
|
|
62
63
|
return (
|
|
63
64
|
<PSnackbar
|
|
65
|
+
style={(Platform as PlatformIOSStatic).isPad ? [styles.iPad] : {}}
|
|
64
66
|
visible={isVisible}
|
|
65
67
|
onDismiss={hide}
|
|
66
68
|
action={
|
|
@@ -81,3 +83,7 @@ Snackbar.displayName = 'Snackbar';
|
|
|
81
83
|
Snackbar.show = (params: SnackbarParams) => {
|
|
82
84
|
rootLevelRef?.show(params);
|
|
83
85
|
};
|
|
86
|
+
|
|
87
|
+
const styles = StyleSheet.create({
|
|
88
|
+
iPad: { zIndex: 100, width: '30%', alignSelf: 'center' },
|
|
89
|
+
});
|