@fto-consult/expo-ui 8.14.2 → 8.14.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.14.2",
3
+ "version": "8.14.4",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
package/src/App.js CHANGED
@@ -13,8 +13,8 @@ import App from "./AppEntry";
13
13
  * }
14
14
  */
15
15
 
16
- export default function ExpoUIAppEntryProvider({children,withSplashScreen,init,...rest}){
16
+ export default function ExpoUIAppEntryProvider({children,init,...rest}){
17
17
  return <Provider {...rest}>
18
- <App withSplashScreen = {withSplashScreen} init={init} children={children}/>
18
+ <App init={init} children={children}/>
19
19
  </Provider>
20
20
  }
@@ -39,7 +39,6 @@ import {Provider as PaperProvider,Portal } from 'react-native-paper';
39
39
  import FontIcon from "$ecomponents/Icon/Font";
40
40
  import useContext from "$econtext/hooks";
41
41
  import { StyleSheet } from "react-native";
42
- import Logo from "$ecomponents/Logo";
43
42
  import AppEntryRootView from "./RootView";
44
43
  import { SafeAreaProvider } from 'react-native-safe-area-context';
45
44
 
@@ -59,10 +58,10 @@ const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE';
59
58
  * initialRouteName : la route initiale par défaut
60
59
  * getStartedRouteName : la route par défaut de getStarted lorsque l'application est en mode getStarted, c'est à dire lorsque la fonction init renvoie une erreur (reject)
61
60
  */
62
- function App({init:initApp,initialRouteName:appInitialRouteName,children,withSplashScreen}) {
61
+ function App({init:initApp,initialRouteName:appInitialRouteName,children}) {
63
62
  AppStateService.init();
64
63
  const SplashScreenComponent = useAppComponent("SplashScreen");
65
- const {FontsIconsFilter,beforeExit,AppWrapper,preferences:appPreferences,navigation,getStartedRouteName,components:{MainProvider}} = useContext();
64
+ const {FontsIconsFilter,beforeExit,AppWrapper,preferences:appPreferences,navigation,getStartedRouteName,withSplashScreen,components:{MainProvider}} = useContext();
66
65
  const {containerProps} = navigation;
67
66
  const [initialState, setInitialState] = React.useState(undefined);
68
67
  const appReadyRef = React.useRef(true);
@@ -253,7 +252,7 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
253
252
  containerProps.onStateChange(state,...rest);
254
253
  }
255
254
  }}
256
- fallback = {React.isValidElement(containerProps.fallback) ? containerProps.fallback : <Logo.Progress/>}
255
+ fallback = {React.isValidElement(containerProps.fallback) ? containerProps.fallback : null}
257
256
  >
258
257
  <Navigation
259
258
  initialRouteName = {defaultStr(hasGetStarted ? appInitialRouteName : getStartedRouteName,"Home")}
@@ -266,9 +265,9 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
266
265
  />
267
266
  </NavigationContainer> : null;
268
267
  const content = isLoaded ? typeof children == 'function'? children({children:child,appConfig,config:appConfig}) : child : null;
269
- const SplashComponent = withSplashScreen === false ? React.Fragment : SplashScreen;
270
- console.log("with splassschend dis ",withSplashScreen," and ",splashProps);
271
- const splashProps = withSplashScreen === false ? {} : {isLoaded,Component:SplashScreenComponent};
268
+ const myChildren = <PreferencesContext.Provider value={preferences}>
269
+ {isLoaded ? React.isValidElement(content) && content || child : null}
270
+ </PreferencesContext.Provider>;
272
271
  return <SafeAreaProvider>
273
272
  <AppEntryRootView MainProvider={MainProvider} isInitialized={state.hasCallInitApp} isLoading={isLoading} hasGetStarted={hasGetStarted} isLoaded={isLoaded}>
274
273
  <PaperProvider
@@ -289,11 +288,11 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
289
288
  <DropdownAlert ref={notificationRef}/>
290
289
  <ErrorBoundary>
291
290
  <StatusBar/>
292
- <SplashComponent {...splashProps}>
293
- <PreferencesContext.Provider value={preferences}>
294
- {isLoaded ? React.isValidElement(content) && content || child : null}
295
- </PreferencesContext.Provider>
296
- </SplashComponent>
291
+ {withSplashScreen !== false ? <SplashScreen
292
+ children = {myChildren}
293
+ isLoaded = {isLoaded}
294
+ Component = {SplashScreenComponent}
295
+ /> : myChildren}
297
296
  </ErrorBoundary>
298
297
  </Portal.Host>
299
298
  </PaperProvider>