@applicaster/zapp-react-native-ui-components 15.0.0-rc.99 → 15.1.0-alpha.1852552014

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.
Files changed (137) hide show
  1. package/Components/BackgroundImage/BackgroundImage.tv.android.tsx +28 -0
  2. package/Components/BackgroundImage/BackgroundImage.tv.ios.tsx +24 -0
  3. package/Components/BackgroundImage/BackgroundImage.tv.web.tsx +42 -0
  4. package/Components/BackgroundImage/index.ts +8 -0
  5. package/Components/BaseFocusable/index.ios.ts +2 -12
  6. package/Components/Cell/FocusableWrapper.tsx +0 -3
  7. package/Components/Cell/TvOSCellComponent.tsx +0 -5
  8. package/Components/CellRendererResolver/index.ts +1 -1
  9. package/Components/ComponentResolver/__tests__/componentResolver.test.js +1 -1
  10. package/Components/Focusable/Focusable.tsx +2 -4
  11. package/Components/Focusable/FocusableTvOS.tsx +1 -18
  12. package/Components/Focusable/__tests__/__snapshots__/FocusableTvOS.test.tsx.snap +0 -1
  13. package/Components/FocusableGroup/FocusableTvOS.tsx +12 -37
  14. package/Components/GeneralContentScreen/GeneralContentScreen.tsx +39 -28
  15. package/Components/GeneralContentScreen/__tests__/GeneralContentScreen.test.tsx +104 -0
  16. package/Components/GeneralContentScreen/utils/__tests__/getScreenDataSource.test.ts +19 -0
  17. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +1 -1
  18. package/Components/GeneralContentScreen/utils/getScreenDataSource.ts +9 -0
  19. package/Components/HandlePlayable/HandlePlayable.tsx +24 -42
  20. package/Components/HandlePlayable/utils.ts +31 -0
  21. package/Components/HookRenderer/HookRenderer.tsx +40 -10
  22. package/Components/HookRenderer/__tests__/HookRenderer.test.tsx +60 -0
  23. package/Components/Layout/FullWidthRow.tsx +38 -0
  24. package/Components/Layout/TV/ScreenContainer.tsx +11 -2
  25. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +5 -1
  26. package/Components/Layout/TV/index.tsx +6 -6
  27. package/Components/Layout/TV/index.web.tsx +6 -6
  28. package/Components/LinkHandler/LinkHandler.tsx +2 -2
  29. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +10 -4
  30. package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +1 -5
  31. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +3 -11
  32. package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +1 -9
  33. package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +14 -15
  34. package/Components/MasterCell/DefaultComponents/LiveImage/__tests__/prepareEntry.test.ts +352 -0
  35. package/Components/MasterCell/DefaultComponents/LiveImage/executePreloadHooks.ts +136 -0
  36. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +34 -16
  37. package/Components/MasterCell/DefaultComponents/SecondaryImage/hooks/__tests__/useGetImageDimensions.test.ts +6 -7
  38. package/Components/MasterCell/DefaultComponents/Text/index.tsx +2 -6
  39. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +2 -6
  40. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/__tests__/getPluginIdentifier.test.ts +11 -233
  41. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/index.ts +15 -19
  42. package/Components/MasterCell/dataAdapter.ts +15 -5
  43. package/Components/MasterCell/index.tsx +10 -1
  44. package/Components/MasterCell/utils/__tests__/resolveColor.test.js +169 -132
  45. package/Components/MasterCell/utils/__tests__/resolveColorForProp.test.js +92 -0
  46. package/Components/MasterCell/utils/index.ts +89 -46
  47. package/Components/Navigator/StackNavigator.tsx +6 -0
  48. package/Components/OfflineHandler/NotificationView/NotificationView.tsx +2 -2
  49. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +18 -17
  50. package/Components/OfflineHandler/__tests__/index.test.tsx +18 -27
  51. package/Components/PlayerContainer/PlayerContainer.tsx +20 -34
  52. package/Components/PlayerContainer/__tests__/PlayerContainer.test.tsx +286 -0
  53. package/Components/PreloaderWrapper/__tests__/index.test.tsx +26 -0
  54. package/Components/PreloaderWrapper/index.tsx +15 -0
  55. package/Components/River/ComponentsMap/ComponentsMap.tsx +3 -4
  56. package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +1 -1
  57. package/Components/River/RefreshControl.tsx +9 -3
  58. package/Components/River/RiverItem.tsx +26 -20
  59. package/Components/River/TV/River.tsx +14 -31
  60. package/Components/River/TV/index.tsx +4 -8
  61. package/Components/River/TV/withTVEventHandler.tsx +36 -0
  62. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +0 -16
  63. package/Components/River/__tests__/componentsMap.test.js +0 -38
  64. package/Components/Screen/TV/hooks/__tests__/useAfterPaint.test.ts +60 -0
  65. package/Components/Screen/TV/hooks/index.ts +2 -0
  66. package/Components/Screen/TV/hooks/useAfterPaint.ts +23 -0
  67. package/Components/Screen/TV/index.web.tsx +18 -11
  68. package/Components/Screen/__tests__/Screen.test.tsx +43 -65
  69. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +44 -68
  70. package/Components/Screen/hooks.ts +76 -5
  71. package/Components/Screen/index.tsx +18 -7
  72. package/Components/Screen/orientationHandler.ts +3 -3
  73. package/Components/ScreenFeedLoader/ScreenFeedLoader.tsx +46 -0
  74. package/Components/ScreenFeedLoader/__tests__/ScreenFeedLoader.test.tsx +94 -0
  75. package/Components/ScreenFeedLoader/index.ts +1 -0
  76. package/Components/ScreenResolver/__tests__/screenResolver.test.js +24 -0
  77. package/Components/ScreenResolver/hooks/index.ts +3 -0
  78. package/Components/ScreenResolver/hooks/useGetComponent.ts +15 -0
  79. package/Components/ScreenResolver/hooks/useScreenComponentResolver.tsx +90 -0
  80. package/Components/ScreenResolver/index.tsx +9 -115
  81. package/Components/ScreenResolver/utils/__tests__/getScreenTypeProps.test.ts +45 -0
  82. package/Components/ScreenResolver/utils/getScreenTypeProps.ts +43 -0
  83. package/Components/ScreenResolver/utils/index.ts +1 -0
  84. package/Components/ScreenResolver/withDefaultScreenContext.tsx +16 -0
  85. package/Components/ScreenResolverFeedProvider/ScreenResolverFeedProvider.tsx +25 -0
  86. package/Components/ScreenResolverFeedProvider/__tests__/ScreenResolverFeedProvider.test.tsx +44 -0
  87. package/Components/ScreenResolverFeedProvider/index.ts +1 -0
  88. package/Components/ScreenRevealManager/Overlay.tsx +34 -0
  89. package/Components/ScreenRevealManager/ScreenRevealManager.ts +8 -40
  90. package/Components/ScreenRevealManager/__tests__/Overlay.test.tsx +88 -0
  91. package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +69 -86
  92. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +10 -18
  93. package/Components/Tabs/TabContent.tsx +4 -7
  94. package/Components/Transitioner/Scene.tsx +9 -15
  95. package/Components/Transitioner/index.js +3 -3
  96. package/Components/VideoLive/LiveImageManager.ts +209 -53
  97. package/Components/VideoLive/PlayerLiveImageComponent.tsx +32 -32
  98. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +2 -17
  99. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +5 -5
  100. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +7 -15
  101. package/Components/VideoModal/utils.ts +16 -13
  102. package/Components/Viewport/ViewportEvents/__tests__/viewportEvents.test.js +1 -1
  103. package/Components/ZappFrameworkComponents/BarView/BarView.tsx +12 -5
  104. package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +2 -2
  105. package/Components/ZappUIComponent/index.tsx +12 -6
  106. package/Components/index.js +1 -1
  107. package/Contexts/CachedDimensionsContext/index.ts +17 -2
  108. package/Contexts/ScreenContext/__tests__/index.test.tsx +57 -0
  109. package/Contexts/ScreenContext/index.tsx +64 -26
  110. package/Contexts/ScreenTrackedViewPositionsContext/__tests__/index.test.tsx +1 -1
  111. package/Contexts/ZappPipesContext/ZappPipesContextFactory.tsx +18 -7
  112. package/Decorators/Analytics/index.tsx +5 -6
  113. package/Decorators/ConfigurationWrapper/__tests__/__snapshots__/withConfigurationProvider.test.tsx.snap +0 -1
  114. package/Decorators/ConfigurationWrapper/const.ts +0 -1
  115. package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -7
  116. package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +212 -5
  117. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +1 -1
  118. package/Decorators/ZappPipesDataConnector/index.tsx +2 -2
  119. package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +1 -1
  120. package/Helpers/ComponentCellSelectionHelper/index.js +0 -6
  121. package/Helpers/DataSourceHelper/index.js +19 -0
  122. package/Helpers/index.js +7 -40
  123. package/package.json +5 -5
  124. package/Components/Layout/TV/LayoutBackground.tsx +0 -31
  125. package/Components/MasterCell/DefaultComponents/Text/utils/__tests__/withAdjustedLineHeight.test.ts +0 -46
  126. package/Components/MasterCell/DefaultComponents/Text/utils/index.ts +0 -21
  127. package/Components/PlayerContainer/ErrorDisplay/ErrorDisplay.tsx +0 -57
  128. package/Components/PlayerContainer/ErrorDisplay/index.ts +0 -9
  129. package/Components/PlayerContainer/useRestrictMobilePlayback.tsx +0 -101
  130. package/Components/River/TV/utils/__tests__/toStringOrEmpty.test.ts +0 -30
  131. package/Components/River/TV/utils/index.ts +0 -4
  132. package/Components/River/TV/withFocusableGroupForContent.tsx +0 -71
  133. package/Components/Screen/utils.ts +0 -16
  134. package/Helpers/Analytics/index.js +0 -95
  135. package/Helpers/DataSourceHelper/__tests__/itemLimitForData.test.ts +0 -80
  136. package/Helpers/DataSourceHelper/index.ts +0 -19
  137. /package/Components/HookRenderer/{index.tsx → index.ts} +0 -0
@@ -2,123 +2,106 @@ import {
2
2
  ScreenRevealManager,
3
3
  COMPONENT_LOADING_STATE,
4
4
  } from "../ScreenRevealManager";
5
- import { Subject } from "rxjs";
6
-
7
- jest.mock("@applicaster/zapp-react-native-utils/arrayUtils", () => ({
8
- makeListOf: jest.fn((value: any, length: number) =>
9
- Array(length).fill(value)
10
- ),
11
- }));
12
-
13
- jest.mock("@applicaster/zapp-react-native-utils/componentsUtils", () => ({
14
- isFirstComponentGallery: jest.fn(),
15
- }));
16
-
17
- jest.mock("@applicaster/zapp-react-native-utils/idleUtils", () => ({
18
- withTimeout$: jest.fn(),
19
- }));
20
-
21
- import { makeListOf } from "@applicaster/zapp-react-native-utils/arrayUtils";
22
- import { isFirstComponentGallery } from "@applicaster/zapp-react-native-utils/componentsUtils";
23
- import { withTimeout$ } from "@applicaster/zapp-react-native-utils/idleUtils";
24
5
 
25
6
  describe("ScreenRevealManager", () => {
26
- let mockCallback: jest.Mock;
27
- let timeout$: Subject<void>;
7
+ const mockCallback = jest.fn();
28
8
 
29
9
  beforeEach(() => {
30
- jest.useFakeTimers();
31
- mockCallback = jest.fn();
32
- timeout$ = new Subject();
33
-
34
- (withTimeout$ as jest.Mock).mockReturnValue(timeout$);
35
- (isFirstComponentGallery as jest.Mock).mockReturnValue(false);
36
-
37
- (makeListOf as jest.Mock).mockImplementation((value, length) =>
38
- Array(length).fill(value)
39
- );
10
+ jest.clearAllMocks();
40
11
  });
41
12
 
42
- afterEach(() => {
43
- jest.clearAllTimers();
44
- jest.useRealTimers();
45
- jest.resetAllMocks();
46
- });
47
-
48
- // ────────────────────────────────────────────────
49
- it("should initialize with correct number of components and UNKNOWN state", () => {
50
- const components = new Array(5).fill({});
51
- const mgr = new ScreenRevealManager(components, mockCallback);
13
+ it("should initialize with the correct number of components to wait for", () => {
14
+ const componentsToRender: ZappUIComponent[] = [
15
+ { component_type: "component1" },
16
+ { component_type: "component2" },
17
+ { component_type: "component3" },
18
+ ];
52
19
 
53
- expect(mgr.numberOfComponentsWaitToLoadBeforePresent).toBe(3);
54
- expect(makeListOf).toHaveBeenCalledWith(COMPONENT_LOADING_STATE.UNKNOWN, 3);
55
- });
20
+ const manager = new ScreenRevealManager(componentsToRender, mockCallback);
56
21
 
57
- // ────────────────────────────────────────────────
58
- it("should set numberOfComponentsWaitToLoadBeforePresent to 1 if first component is gallery", () => {
59
- (isFirstComponentGallery as jest.Mock).mockReturnValue(true);
22
+ expect(manager.numberOfComponentsWaitToLoadBeforePresent).toBe(3);
60
23
 
61
- const components = new Array(5).fill({});
62
- const mgr = new ScreenRevealManager(components, mockCallback);
63
-
64
- expect(mgr.numberOfComponentsWaitToLoadBeforePresent).toBe(1);
24
+ expect(manager.renderingState).toEqual([
25
+ COMPONENT_LOADING_STATE.UNKNOWN,
26
+ COMPONENT_LOADING_STATE.UNKNOWN,
27
+ COMPONENT_LOADING_STATE.UNKNOWN,
28
+ ]);
65
29
  });
66
30
 
67
- // ────────────────────────────────────────────────
68
- it("should trigger callback after all components load successfully", () => {
69
- const components = new Array(3).fill({});
70
- const mgr = new ScreenRevealManager(components, mockCallback);
31
+ it("should call the callback when the required number of components are loaded successfully", () => {
32
+ const componentsToRender: ZappUIComponent[] = [
33
+ { component_type: "component1" },
34
+ { component_type: "component2" },
35
+ { component_type: "component3" },
36
+ ];
71
37
 
72
- mgr.onLoadFinished(0);
73
- expect(mockCallback).not.toHaveBeenCalled();
38
+ const manager = new ScreenRevealManager(componentsToRender, mockCallback);
74
39
 
75
- mgr.onLoadFinished(1);
76
- expect(mockCallback).not.toHaveBeenCalled();
40
+ manager.onLoadFinished(0);
41
+ manager.onLoadFinished(1);
42
+ manager.onLoadFinished(2);
77
43
 
78
- mgr.onLoadFinished(2);
79
44
  expect(mockCallback).toHaveBeenCalledTimes(1);
80
45
  });
81
46
 
82
- // ────────────────────────────────────────────────
83
- it("should trigger callback after some components fail to load but all finished", () => {
84
- const components = new Array(3).fill({});
85
- const mgr = new ScreenRevealManager(components, mockCallback);
47
+ it("should call the callback when the required number of components fail to load", () => {
48
+ const componentsToRender: ZappUIComponent[] = [
49
+ { component_type: "component1" },
50
+ { component_type: "component2" },
51
+ { component_type: "component3" },
52
+ ];
53
+
54
+ const manager = new ScreenRevealManager(componentsToRender, mockCallback);
86
55
 
87
- mgr.onLoadFinished(0);
88
- mgr.onLoadFailed(1);
89
- mgr.onLoadFailed(2);
56
+ manager.onLoadFailed(0);
57
+ manager.onLoadFailed(1);
58
+ manager.onLoadFailed(2);
90
59
 
91
60
  expect(mockCallback).toHaveBeenCalledTimes(1);
92
61
  });
93
62
 
94
- // ────────────────────────────────────────────────
95
- it("should not trigger callback twice when same component finishes twice", () => {
96
- const components = new Array(3).fill({});
97
- const mgr = new ScreenRevealManager(components, mockCallback);
63
+ it("should call the callback when a mix of successful and failed loads meet the required number", () => {
64
+ const componentsToRender: ZappUIComponent[] = [
65
+ { component_type: "component1" },
66
+ { component_type: "component2" },
67
+ { component_type: "component3" },
68
+ ];
69
+
70
+ const manager = new ScreenRevealManager(componentsToRender, mockCallback);
98
71
 
99
- mgr.onLoadFinished(0);
100
- mgr.onLoadFinished(0); // duplicate
101
- mgr.onLoadFinished(1);
102
- mgr.onLoadFinished(2);
72
+ manager.onLoadFinished(0);
73
+ manager.onLoadFailed(1);
74
+ manager.onLoadFinished(2);
103
75
 
104
76
  expect(mockCallback).toHaveBeenCalledTimes(1);
105
77
  });
106
78
 
107
- // ────────────────────────────────────────────────
108
- it("should trigger callback when timeout$ emits before all loaded", () => {
109
- const components = new Array(3).fill({});
110
- new ScreenRevealManager(components, mockCallback);
79
+ it("should not call the callback if the required number of components are not loaded", () => {
80
+ const componentsToRender: ZappUIComponent[] = [
81
+ { component_type: "component1" },
82
+ { component_type: "component2" },
83
+ { component_type: "component3" },
84
+ ];
111
85
 
112
- timeout$.next(); // simulate timeout event from withTimeout$
86
+ const manager = new ScreenRevealManager(componentsToRender, mockCallback);
113
87
 
114
- expect(mockCallback).toHaveBeenCalledTimes(1);
88
+ manager.onLoadFinished(0);
89
+ manager.onLoadFailed(1);
90
+
91
+ expect(mockCallback).not.toHaveBeenCalled();
115
92
  });
116
93
 
117
- // ────────────────────────────────────────────────
118
- it("should not call callback if nothing loads and no timeout emitted", () => {
119
- const components = new Array(3).fill({});
120
- new ScreenRevealManager(components, mockCallback);
94
+ it("should call the callback when the when first component is gallery and it was loaded successfully", () => {
95
+ const componentsToRender: ZappUIComponent[] = [
96
+ { component_type: "gallery-qb" },
97
+ { component_type: "component2" },
98
+ { component_type: "component3" },
99
+ ];
121
100
 
122
- expect(mockCallback).not.toHaveBeenCalled();
101
+ const manager = new ScreenRevealManager(componentsToRender, mockCallback);
102
+
103
+ manager.onLoadFinished(0);
104
+
105
+ expect(mockCallback).toHaveBeenCalledTimes(1);
123
106
  });
124
107
  });
@@ -1,8 +1,10 @@
1
1
  import * as React from "react";
2
- import { Animated, StyleSheet } from "react-native";
2
+ import { Animated } from "react-native";
3
+
3
4
  import { isFirstComponentScreenPicker } from "@applicaster/zapp-react-native-utils/componentsUtils";
4
5
  import { useRefWithInitialValue } from "@applicaster/zapp-react-native-utils/reactHooks/state/useRefWithInitialValue";
5
6
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
7
+ import { Overlay } from "./Overlay";
6
8
 
7
9
  import { ScreenRevealManager } from "./ScreenRevealManager";
8
10
  import {
@@ -10,13 +12,6 @@ import {
10
12
  emitScreenRevealManagerIsNotReadyToShow,
11
13
  } from "./utils";
12
14
 
13
- const styles = StyleSheet.create({
14
- container: {
15
- ...StyleSheet.absoluteFillObject,
16
- position: "absolute",
17
- },
18
- });
19
-
20
15
  export const TIMEOUT = 300; // 300 ms
21
16
 
22
17
  const HIDDEN = 0; // opacity = 0
@@ -25,6 +20,7 @@ export const SHOWN = 1; // opacity = 1
25
20
 
26
21
  type Props = {
27
22
  componentsToRender: ZappUIComponent[];
23
+ backgroundColor?: string;
28
24
  };
29
25
 
30
26
  export const withScreenRevealManager = (Component) => {
@@ -76,7 +72,7 @@ export const withScreenRevealManager = (Component) => {
76
72
 
77
73
  if (isFirstComponentScreenPicker(componentsToRender)) {
78
74
  // for screen-picker with have additional internal ComponentsMap, no need to add this wrapper
79
- return <Component {...props} />;
75
+ return <Component {...props} initialNumberToLoad={1} />;
80
76
  }
81
77
 
82
78
  return (
@@ -92,15 +88,11 @@ export const withScreenRevealManager = (Component) => {
92
88
  onLoadFailedFromScreenRevealManager={managerRef.current.onLoadFailed}
93
89
  />
94
90
  {isShowOverlay ? (
95
- <Animated.View
96
- style={[
97
- styles.container,
98
- {
99
- opacity: opacityRef.current,
100
- backgroundColor: theme.app_background_color,
101
- },
102
- ]}
103
- testID="animated-component"
91
+ <Overlay
92
+ opacity={opacityRef.current}
93
+ backgroundColor={
94
+ props.backgroundColor ?? theme.app_background_color
95
+ }
104
96
  />
105
97
  ) : null}
106
98
  </>
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
- import { View, StyleSheet } from "react-native";
2
+ import { View, ViewStyle } from "react-native";
3
3
 
4
4
  import { River } from "@applicaster/zapp-react-native-ui-components/Components";
5
5
  import { withNestedNavigationContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/NestedNavigationContext";
6
6
 
7
7
  type Props = {
8
+ styles: Record<string, ViewStyle>;
8
9
  minHeight: number;
9
10
  changingTab: boolean;
10
11
  feedUrl: string;
@@ -13,14 +14,9 @@ type Props = {
13
14
  backgroundColor: string;
14
15
  };
15
16
 
16
- const styles = StyleSheet.create({
17
- riverWrapper: {
18
- flex: 1,
19
- },
20
- });
21
-
22
17
  function TabContentComponent(props: Props) {
23
18
  const {
19
+ styles,
24
20
  minHeight,
25
21
  backgroundColor,
26
22
  changingTab,
@@ -33,6 +29,7 @@ function TabContentComponent(props: Props) {
33
29
  <View
34
30
  style={[
35
31
  styles.riverWrapper,
32
+
36
33
  {
37
34
  backgroundColor,
38
35
  minHeight,
@@ -1,9 +1,9 @@
1
- import React, { useEffect } from "react";
1
+ import React from "react";
2
2
  import { equals } from "ramda";
3
3
  import { Animated, ViewProps, ViewStyle } from "react-native";
4
- import { useSafeAreaFrame } from "react-native-safe-area-context";
5
4
 
6
5
  import { useScreenOrientationHandler } from "@applicaster/zapp-react-native-ui-components/Components/Screen/orientationHandler";
6
+ import { useMemoizedSafeAreaFrameWithActiveState } from "@applicaster/zapp-react-native-ui-components/Components/Screen/hooks";
7
7
 
8
8
  import { PathnameContext } from "../../Contexts/PathnameContext";
9
9
  import { ScreenDataContext } from "../../Contexts/ScreenDataContext";
@@ -94,19 +94,13 @@ function SceneComponent({
94
94
  isActive,
95
95
  });
96
96
 
97
- const frame = useSafeAreaFrame();
98
-
99
- const [memoFrame, setMemoFrame] = React.useState(frame);
100
-
101
- useEffect(() => {
102
- if (isActive) {
103
- setMemoFrame((oldFrame) =>
104
- oldFrame.width === frame.width && oldFrame.height === frame.height
105
- ? oldFrame
106
- : frame
107
- );
108
- }
109
- }, [isActive, frame.width, frame.height]);
97
+ // Use shared memoized frame hook - synchronized with useWaitForValidOrientation
98
+ // to prevent race conditions during orientation changes
99
+ // Pass isActive from props since Scene knows its active state from Transitioner
100
+ const memoFrame = useMemoizedSafeAreaFrameWithActiveState({
101
+ updateForInactiveScreens: false,
102
+ isActive,
103
+ });
110
104
 
111
105
  const isAnimating = animating && overlayStyle;
112
106
 
@@ -1,8 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
3
3
  import { useDimensions } from "@applicaster/zapp-react-native-utils/reactHooks/layout";
4
- import { useAppData } from "@applicaster/zapp-react-native-redux";
5
-
4
+ import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
6
5
  import { TransitionerComponent } from "./Transitioner";
7
6
 
8
7
  export const Transitioner = (props) => {
@@ -17,7 +16,8 @@ export const Transitioner = (props) => {
17
16
  deviceInfo: true,
18
17
  });
19
18
 
20
- const { isTabletPortrait } = useAppData();
19
+ const { appData } = usePickFromState(["appData"]);
20
+ const isTabletPortrait = appData?.isTabletPortrait;
21
21
 
22
22
  return (
23
23
  <TransitionerComponent