@fto-consult/expo-ui 8.14.1 → 8.14.3

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.1",
3
+ "version": "8.14.3",
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
  }
@@ -59,10 +59,10 @@ const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE';
59
59
  * initialRouteName : la route initiale par défaut
60
60
  * 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
61
  */
62
- function App({init:initApp,initialRouteName:appInitialRouteName,children,withSplashScreen}) {
62
+ function App({init:initApp,initialRouteName:appInitialRouteName,children}) {
63
63
  AppStateService.init();
64
64
  const SplashScreenComponent = useAppComponent("SplashScreen");
65
- const {FontsIconsFilter,beforeExit,AppWrapper,preferences:appPreferences,navigation,getStartedRouteName,components:{MainProvider}} = useContext();
65
+ const {FontsIconsFilter,beforeExit,AppWrapper,preferences:appPreferences,navigation,getStartedRouteName,withSplashScreen,components:{MainProvider}} = useContext();
66
66
  const {containerProps} = navigation;
67
67
  const [initialState, setInitialState] = React.useState(undefined);
68
68
  const appReadyRef = React.useRef(true);
@@ -266,8 +266,9 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
266
266
  />
267
267
  </NavigationContainer> : null;
268
268
  const content = isLoaded ? typeof children == 'function'? children({children:child,appConfig,config:appConfig}) : child : null;
269
- const SplashComponent = withSplashScreen === false ? React.Fragment : SplashScreen;
270
- const splashProps = withSplashScreen === false ? {} : {isLoaded,Component:SplashScreenComponent};
269
+ const myChildren = <PreferencesContext.Provider value={preferences}>
270
+ {isLoaded ? React.isValidElement(content) && content || child : null}
271
+ </PreferencesContext.Provider>;
271
272
  return <SafeAreaProvider>
272
273
  <AppEntryRootView MainProvider={MainProvider} isInitialized={state.hasCallInitApp} isLoading={isLoading} hasGetStarted={hasGetStarted} isLoaded={isLoaded}>
273
274
  <PaperProvider
@@ -288,11 +289,11 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
288
289
  <DropdownAlert ref={notificationRef}/>
289
290
  <ErrorBoundary>
290
291
  <StatusBar/>
291
- <SplashComponent {...splashProps}>
292
- <PreferencesContext.Provider value={preferences}>
293
- {isLoaded ? React.isValidElement(content) && content || child : null}
294
- </PreferencesContext.Provider>
295
- </SplashComponent>
292
+ {withSplashScreen !== false ? <SplashScreen
293
+ children = {myChildren}
294
+ isLoaded = {isLoaded}
295
+ Component = {SplashScreenComponent}
296
+ /> : myChildren}
296
297
  </ErrorBoundary>
297
298
  </Portal.Host>
298
299
  </PaperProvider>