@fto-consult/expo-ui 1.5.0 → 1.5.2
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
CHANGED
package/src/auth/Login.js
CHANGED
|
@@ -86,9 +86,8 @@ export default function LoginComponent(props){
|
|
|
86
86
|
},1000)
|
|
87
87
|
}
|
|
88
88
|
},[withPortal])
|
|
89
|
-
const {header,children,initialize,contentTop,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,mutateData,canSubmit:canSubmitForm,onStepChange,...loginProps} = defaultObj(getProps({
|
|
89
|
+
const {header,withScrollView:customWithScrollView,children,initialize,contentTop,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,mutateData,canSubmit:canSubmitForm,onStepChange,...loginProps} = defaultObj(getProps({
|
|
90
90
|
...state,
|
|
91
|
-
withScrollView:customerWithScrollView,
|
|
92
91
|
setState,
|
|
93
92
|
state,
|
|
94
93
|
showError : notifyUser,
|
|
@@ -171,7 +170,18 @@ export default function LoginComponent(props){
|
|
|
171
170
|
setState({...state,step:step+1,data})
|
|
172
171
|
}
|
|
173
172
|
}
|
|
174
|
-
const
|
|
173
|
+
const loginFields = {};
|
|
174
|
+
let hasLoginFields = false;
|
|
175
|
+
Object.map(loginProps.fields,(field,i)=>{
|
|
176
|
+
if(isObj(field)){
|
|
177
|
+
if(typeof field.step ==='number' && field.step !== state.step){}
|
|
178
|
+
else {
|
|
179
|
+
loginFields[i] = Object.clone(field);
|
|
180
|
+
loginFields[i].autoFocus = !!loginFields[i].autoFocusOnStep;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
const withScrollView = typeof customWithScrollView =='boolean'? customWithScrollView : true;
|
|
175
185
|
const Wrapper = withPortal ? ScreenWithoutAuthContainer : withScrollView ? ScrollView: View;
|
|
176
186
|
const wrapperProps = withPortal ? {appBarProps,authRequired:false,title:loginTitle,withScrollView} : { style:styles.wrapper};
|
|
177
187
|
return <Wrapper testID = {testID+"_Wrapper" }{...wrapperProps}>
|
|
@@ -193,6 +203,7 @@ export default function LoginComponent(props){
|
|
|
193
203
|
</View>}
|
|
194
204
|
responsive = {false}
|
|
195
205
|
{...loginProps}
|
|
206
|
+
fields = {loginFields}
|
|
196
207
|
formProps = {{
|
|
197
208
|
keyboardEvents : {
|
|
198
209
|
...defaultObj(keyboardEvents),
|
|
@@ -205,7 +216,7 @@ export default function LoginComponent(props){
|
|
|
205
216
|
>
|
|
206
217
|
<>
|
|
207
218
|
{React.isValidElement(contentTop)? contentTop : null}
|
|
208
|
-
{
|
|
219
|
+
{hasLoginFields?<View testID={testID+"_ButtonsContainer"} style={[styles.buttonWrapper]}>
|
|
209
220
|
<Button
|
|
210
221
|
ref = {nextButtonRef}
|
|
211
222
|
primary
|
|
@@ -14,6 +14,7 @@ import {navigate} from "$cnavigation";
|
|
|
14
14
|
import theme from "$theme";
|
|
15
15
|
import {isMobileNative} from "$cplatform";
|
|
16
16
|
import appConfig from "$capp/config";
|
|
17
|
+
import Preloader from "$preloader";
|
|
17
18
|
const UserProfileAvatarComponent = React.forwardRef(({drawerRef,...props},ref)=>{
|
|
18
19
|
let u = defaultObj(Auth.getLoggedUser());
|
|
19
20
|
const deviceNameRef = React.useRef(null);
|
|
@@ -46,7 +47,10 @@ const UserProfileAvatarComponent = React.forwardRef(({drawerRef,...props},ref)=>
|
|
|
46
47
|
label : i18n.lang("logout",'Déconnexion'),
|
|
47
48
|
icon : "logout",
|
|
48
49
|
onPress : (a)=>{
|
|
49
|
-
closeDrawer(
|
|
50
|
+
closeDrawer(()=>{
|
|
51
|
+
Preloader.open("Déconnexion en cours...");
|
|
52
|
+
Auth.signOut().finally(Preloader.close)
|
|
53
|
+
});
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
];
|