@fto-consult/expo-ui 1.2.14 → 1.3.1
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 +2 -2
- package/src/auth/Login.js +10 -4
- package/src/navigation/Drawer/index.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@expo/html-elements": "^0.2.0",
|
|
62
62
|
"@expo/metro-config": "^0.4.0",
|
|
63
63
|
"@expo/webpack-config": "^0.17.2",
|
|
64
|
-
"@fto-consult/common": "^1.5.
|
|
64
|
+
"@fto-consult/common": "^1.5.1",
|
|
65
65
|
"@gorhom/portal": "^1.0.14",
|
|
66
66
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
|
67
67
|
"@react-native-community/datetimepicker": "6.2.0",
|
package/src/auth/Login.js
CHANGED
|
@@ -85,7 +85,7 @@ export default function LoginComponent(props){
|
|
|
85
85
|
},1000)
|
|
86
86
|
}
|
|
87
87
|
},[withPortal])
|
|
88
|
-
const {header,children,initialize,contentTop,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,canSubmit:canSubmitForm,onStepChange,...loginProps} = defaultObj(getProps({
|
|
88
|
+
const {header,children,initialize,contentTop,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,mutateData,canSubmit:canSubmitForm,onStepChange,...loginProps} = defaultObj(getProps({
|
|
89
89
|
...state,
|
|
90
90
|
setState,
|
|
91
91
|
state,
|
|
@@ -129,7 +129,7 @@ export default function LoginComponent(props){
|
|
|
129
129
|
notifyUser(form.getErrorText());
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
const args = {data,form,state,step,nextButtonRef,previousButtonRef};
|
|
132
|
+
const args = {...state,data,form,state,step,setState,nextButtonRef,previousButtonRef};
|
|
133
133
|
if(nextButtonRef.current && nextButtonRef.current.isDisabled()){
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
@@ -148,6 +148,10 @@ export default function LoginComponent(props){
|
|
|
148
148
|
}
|
|
149
149
|
if(step > 1){
|
|
150
150
|
if(canSubmit(args)){
|
|
151
|
+
///pour modifier automatiquement la données à mettre à jour
|
|
152
|
+
if(typeof mutateData =='function'){
|
|
153
|
+
mutateData(data);
|
|
154
|
+
}
|
|
151
155
|
Preloader.open("vérification ...");
|
|
152
156
|
return auth.signIn(data).then((a)=>{
|
|
153
157
|
if(typeof onLoginSuccess =='function' && onLoginSuccess(a)=== false) return;
|
|
@@ -178,8 +182,10 @@ export default function LoginComponent(props){
|
|
|
178
182
|
style = {[styles.formData,{backgroundColor}]}
|
|
179
183
|
header = {<View style = {[styles.header]}>
|
|
180
184
|
<Avatar testID={testID+"_Avatar"} size={50} secondary icon = 'lock'/>
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
{
|
|
186
|
+
React.isValidElement(header)? header :
|
|
187
|
+
<Label testID={testID+"_HeaderText"} bool style={{color:theme.colors.primaryOnSurface,fontSize:18,paddingTop:10}}>Connectez vous SVP</Label>
|
|
188
|
+
}
|
|
183
189
|
</View>}
|
|
184
190
|
responsive = {false}
|
|
185
191
|
{...loginProps}
|
|
@@ -46,6 +46,7 @@ const DrawerNavigator = React.forwardRef(({content,children,state,...props},ref)
|
|
|
46
46
|
if(prevIsLoggedIn === isLoggedIn) return;
|
|
47
47
|
navigate("Home");
|
|
48
48
|
},[isLoggedIn]);
|
|
49
|
+
console.log(isLoggedIn," is loggggedd in ddd",isAuthLoggedIn)
|
|
49
50
|
if(!isLoggedIn) {
|
|
50
51
|
return <Login withPortal
|
|
51
52
|
onSuccess = {(data)=>{
|