@fto-consult/expo-ui 6.31.8 → 6.31.9
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/src/components/Logo/index.js +7 -2
- package/src/context/Provider.js +4 -1
- package/src/index.js +10 -4
package/package.json
CHANGED
package/src/context/Provider.js
CHANGED
|
@@ -36,7 +36,8 @@ import { prepareScreens } from "./TableData";
|
|
|
36
36
|
},
|
|
37
37
|
navigation : {
|
|
38
38
|
screens : {Array}, les écrans de navigation,
|
|
39
|
-
drawerItems : {object|array|function}, la fonction permettant d'obtenir les items du drawer principal de l'application
|
|
39
|
+
drawerItems : {object|array|function}, la fonction permettant d'obtenir les items du drawer principal de l'application,
|
|
40
|
+
containerProps : {object}, les props à passer au composant NavigationContainer de react-navigation
|
|
40
41
|
}
|
|
41
42
|
*/
|
|
42
43
|
const Provider = ({children,getTableData,handleHelpScreen,navigation,components,convertFiltersToSQL,getStructData,tablesData,structsData,...props})=>{
|
|
@@ -124,6 +125,8 @@ const Provider = ({children,getTableData,handleHelpScreen,navigation,components,
|
|
|
124
125
|
});
|
|
125
126
|
return [...r,...getMainScreens(handleHelpScreen)];
|
|
126
127
|
},[]);
|
|
128
|
+
navigation.containerProps = defaultObj(navigation.containerProps);
|
|
129
|
+
const {linking} = navigation;
|
|
127
130
|
return <ExpoUIContext.Provider
|
|
128
131
|
value={{
|
|
129
132
|
...props,
|
package/src/index.js
CHANGED
|
@@ -40,6 +40,7 @@ import FontIcon from "$ecomponents/Icon/Font";
|
|
|
40
40
|
import useContext from "$econtext/hooks";
|
|
41
41
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
42
42
|
import { StyleSheet } from "react-native";
|
|
43
|
+
import Logo from "$ecomponents/Logo";
|
|
43
44
|
export * from "./context";
|
|
44
45
|
|
|
45
46
|
let MAX_BACK_COUNT = 1;
|
|
@@ -60,7 +61,8 @@ const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE';
|
|
|
60
61
|
*/
|
|
61
62
|
function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount}) {
|
|
62
63
|
AppStateService.init();
|
|
63
|
-
const {FontsIconsFilter,beforeExit,preferences:appPreferences,getStartedRouteName} = useContext();
|
|
64
|
+
const {FontsIconsFilter,beforeExit,preferences:appPreferences,navigation,getStartedRouteName} = useContext();
|
|
65
|
+
const {containerProps} = navigation;
|
|
64
66
|
const [initialState, setInitialState] = React.useState(undefined);
|
|
65
67
|
const appReadyRef = React.useRef(true);
|
|
66
68
|
const [state,setState] = React.useState({
|
|
@@ -256,10 +258,14 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount})
|
|
|
256
258
|
const child = isLoaded ? <NavigationContainer
|
|
257
259
|
ref={navigationRef}
|
|
258
260
|
initialState={initialState}
|
|
259
|
-
|
|
261
|
+
{...containerProps}
|
|
262
|
+
onStateChange={(state,...rest) =>{
|
|
260
263
|
setSession(NAVIGATION_PERSISTENCE_KEY,decycle(state),false);
|
|
261
|
-
|
|
262
|
-
|
|
264
|
+
if(typeof containerProps.onStateChange =='function'){
|
|
265
|
+
containerProps.onStateChange(state,...rest);
|
|
266
|
+
}
|
|
267
|
+
}}
|
|
268
|
+
fallback = {React.isValidElement(containerProps.fallback) ? containerProps.fallback : <Logo.Progress/>}
|
|
263
269
|
>
|
|
264
270
|
<Navigation
|
|
265
271
|
initialRouteName = {defaultStr(hasGetStarted ? appInitialRouteName : getStartedRouteName,"Home")}
|