@applicaster/zapp-react-native-ui-components 13.0.0-alpha.6714678893 → 13.0.0-alpha.7100577251

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 (123) hide show
  1. package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
  2. package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
  3. package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
  4. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +6 -6
  5. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +7 -7
  6. package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
  7. package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
  8. package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
  9. package/Components/BaseFocusable/index.ios.ts +1 -1
  10. package/Components/BaseFocusable/index.tsx +66 -29
  11. package/Components/Cell/Cell.tsx +7 -3
  12. package/Components/Cell/TvOSCellComponent.tsx +4 -8
  13. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +20 -20
  14. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +5 -3
  15. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +5 -5
  16. package/Components/ComponentResolver/__tests__/componentResolver.test.js +11 -9
  17. package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
  18. package/Components/Focusable/Focusable.tsx +0 -54
  19. package/Components/Focusable/FocusableTvOS.tsx +1 -5
  20. package/Components/Focusable/Touchable.tsx +19 -20
  21. package/Components/FocusableList/index.tsx +0 -1
  22. package/Components/FocusableScrollView/index.tsx +12 -39
  23. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +9 -0
  24. package/Components/GeneralContentScreen/utils/useCurationAPI.ts +1 -1
  25. package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +1 -0
  26. package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
  27. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -3
  28. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +9 -9
  29. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  30. package/Components/Layout/TV/__tests__/index.test.tsx +7 -3
  31. package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
  32. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
  33. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +6 -12
  34. package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
  35. package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
  36. package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
  37. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
  38. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  39. package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
  40. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +7 -7
  41. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +34 -34
  42. package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
  43. package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
  44. package/Components/MasterCell/utils/index.ts +1 -1
  45. package/Components/ModalComponent/Header/index.tsx +3 -3
  46. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
  47. package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
  48. package/Components/PlayerContainer/PlayerContainer.tsx +5 -11
  49. package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
  50. package/Components/PlayerImageBackground/index.tsx +23 -3
  51. package/Components/River/ComponentsMap/ComponentsMap.tsx +39 -65
  52. package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
  53. package/Components/River/RefreshControl.tsx +1 -1
  54. package/Components/River/RiverFooter.tsx +39 -9
  55. package/Components/River/RiverItem.tsx +37 -2
  56. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +114 -45
  57. package/Components/River/__tests__/__snapshots__/river.test.js.snap +12 -12
  58. package/Components/River/__tests__/componentsMap.test.js +64 -17
  59. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +1 -1
  60. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +1 -1
  61. package/Components/Screen/__tests__/Screen.test.tsx +41 -27
  62. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -4
  63. package/Components/Screen/hooks.ts +56 -0
  64. package/Components/Screen/index.tsx +13 -39
  65. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +2 -2
  66. package/Components/ScreenResolver/__tests__/screenResolver.test.js +31 -27
  67. package/Components/Tabs/Tab.tsx +7 -6
  68. package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
  69. package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
  70. package/Components/TextInputTv/index.tsx +4 -4
  71. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
  72. package/Components/Transitioner/AnimationManager.js +8 -8
  73. package/Components/Transitioner/Scene.tsx +52 -23
  74. package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
  75. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +62 -46
  76. package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
  77. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +4 -4
  78. package/Components/Transitioner/index.js +8 -4
  79. package/Components/VideoLive/LiveImageManager.ts +27 -1
  80. package/Components/VideoLive/PlayerLiveImageComponent.tsx +29 -21
  81. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
  82. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +5 -10
  83. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +5 -1
  84. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +5 -1
  85. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +8 -7
  86. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +4 -10
  87. package/Components/VideoModal/ModalAnimation/index.ts +2 -1
  88. package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
  89. package/Components/VideoModal/ModalAnimation/utils.ts +2 -2
  90. package/Components/VideoModal/OpaqueLayer.tsx +33 -0
  91. package/Components/VideoModal/PlayerDetails.tsx +4 -1
  92. package/Components/VideoModal/PlayerWrapper.tsx +16 -35
  93. package/Components/VideoModal/VideoModal.tsx +14 -23
  94. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
  95. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
  96. package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
  97. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -156
  98. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
  99. package/Components/VideoModal/hooks/index.ts +7 -0
  100. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
  101. package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
  102. package/Components/VideoModal/hooks/utils/index.ts +33 -0
  103. package/Components/VideoModal/utils.ts +3 -5
  104. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +2 -2
  105. package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
  106. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +11 -11
  107. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +30 -30
  108. package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
  109. package/Contexts/ScreenContext/index.tsx +3 -2
  110. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +2 -2
  111. package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
  112. package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
  113. package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
  114. package/Decorators/RiverFeedLoader/index.tsx +1 -1
  115. package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
  116. package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
  117. package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
  118. package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +5 -5
  119. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +16 -10
  120. package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
  121. package/Decorators/ZappPipesDataConnector/index.tsx +32 -2
  122. package/package.json +12 -6
  123. package/Decorators/RiverFeedLoader/utils.ts +0 -100
@@ -41,7 +41,10 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
41
41
  videoModalState: { mode: videoModalMode },
42
42
  } = useNavigation();
43
43
 
44
- const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
44
+ const { isLanguageOverlayVisible, isSeekBarTouch } = React.useContext(
45
+ PlayerContainerContext
46
+ );
47
+
45
48
  const isMaximazedModal = videoModalMode === "MAXIMIZED";
46
49
  const isMinimizedModal = videoModalMode === "MINIMIZED";
47
50
 
@@ -52,6 +55,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
52
55
  const isEnablePanGesture =
53
56
  !isLanguageOverlayVisible &&
54
57
  isNotMinimizeMaximazeAnimation &&
58
+ !isSeekBarTouch &&
55
59
  (isMaximazedModal || isMinimizedModal);
56
60
 
57
61
  const onGestureEvent = Animated.event(
@@ -77,7 +77,7 @@ export const AnimationView = ({
77
77
  const measureView = React.useCallback(() => {
78
78
  if (isTabletLandscape && tabletLandscapePlayerTopPosition === 0) {
79
79
  animationComponentRef.current.measure(
80
- (x, y, width, height, pageX, pageY) => {
80
+ (_x, _y, _width, _height, _pageX, pageY) => {
81
81
  setTabletLandscapePlayerTopPosition(pageY - 20);
82
82
  }
83
83
  );
@@ -100,10 +100,11 @@ export const AnimationView = ({
100
100
  const moveUpValue = additionalData.saveArea
101
101
  ? -insets.top + (isAudioItem ? 0 : progressBarHeight)
102
102
  : isTablet
103
- ? isTabletLandscape && (!isAudioItem || (isAudioItem && inlineAudioPlayer))
104
- ? -tabletLandscapePlayerTopPosition + progressBarHeight
105
- : -130
106
- : -50 + progressBarHeight;
103
+ ? isTabletLandscape &&
104
+ (!isAudioItem || (isAudioItem && inlineAudioPlayer))
105
+ ? -tabletLandscapePlayerTopPosition + progressBarHeight
106
+ : -130
107
+ : -50 + progressBarHeight;
107
108
 
108
109
  const moveComponentHorizontalValue = additionalData.moveValue
109
110
  ? isRTL
@@ -434,8 +435,8 @@ export const AnimationComponent = (props: Props) => {
434
435
  const Component = useAnimation
435
436
  ? AnimationView
436
437
  : style
437
- ? View
438
- : React.Fragment;
438
+ ? View
439
+ : React.Fragment;
439
440
 
440
441
  if (
441
442
  additionalData.extraAnimation &&
@@ -1,14 +1,12 @@
1
- import React, { useContext } from "react";
1
+ import React from "react";
2
2
  import { Animated } from "react-native";
3
3
 
4
4
  import {
5
5
  useSafeAreaInsets,
6
6
  useSafeAreaFrame,
7
7
  } from "react-native-safe-area-context";
8
- import {
9
- useGetBottomTabBarHeight,
10
- useNavigation,
11
- } from "@applicaster/zapp-react-native-utils/reactHooks";
8
+ import { useGetBottomTabBarHeight } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useGetBottomTabBarHeight";
9
+ import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
12
10
  import { isLive } from "@applicaster/zapp-react-native-utils/playerUtils";
13
11
 
14
12
  import { PROGRESS_BAR_HEIGHT } from "./utils";
@@ -48,7 +46,7 @@ export type ModalAnimationContextT = {
48
46
  progressBarHeight: number;
49
47
  };
50
48
 
51
- const ReactContext = React.createContext<ModalAnimationContextT>({
49
+ export const ReactContext = React.createContext<ModalAnimationContextT>({
52
50
  isActiveGesture: false,
53
51
  playerAnimationState: null,
54
52
  setPlayerAnimationState: () => null,
@@ -73,10 +71,6 @@ const ReactContext = React.createContext<ModalAnimationContextT>({
73
71
  progressBarHeight: 0,
74
72
  });
75
73
 
76
- export function useModalAnimationContext() {
77
- return useContext<ModalAnimationContextT>(ReactContext);
78
- }
79
-
80
74
  const Provider = ({ children }: { children: React.ReactNode }) => {
81
75
  const [playerAnimationState, setPlayerAnimationState] =
82
76
  React.useState<PlayerAnimationStateT>(null);
@@ -6,10 +6,11 @@ export { AnimatedVideoPlayerComponent } from "./AnimatedVideoPlayerComponent";
6
6
 
7
7
  export {
8
8
  withModalAnimationProvider,
9
- useModalAnimationContext,
10
9
  PlayerAnimationStateEnum,
11
10
  } from "./ModalAnimationContext";
12
11
 
12
+ export { useModalAnimationContext } from "./useModalAnimationContext";
13
+
13
14
  export { AnimationComponent } from "./AnimationComponent";
14
15
 
15
16
  export { ComponentAnimationType, defaultAspectRatioWidth } from "./utils";
@@ -0,0 +1,6 @@
1
+ import { useContext } from "react";
2
+ import { ModalAnimationContextT, ReactContext } from "./ModalAnimationContext";
3
+
4
+ export function useModalAnimationContext() {
5
+ return useContext<ModalAnimationContextT>(ReactContext);
6
+ }
@@ -108,8 +108,8 @@ export const calculateAnimationValue = (animationType, dragPosition, data) => {
108
108
  : { forWidth: 3, forHeight: 3 }
109
109
  : { forWidth: 2, forHeight: 2 }
110
110
  : isTabletLandscape
111
- ? { forWidth: 8, forHeight: 6.5 }
112
- : { forWidth: 3.5, forHeight: 2 };
111
+ ? { forWidth: 8, forHeight: 6.5 }
112
+ : { forWidth: 3.5, forHeight: 2 };
113
113
 
114
114
  const minWidth =
115
115
  isAudioItem && !inlineAudioPlayer ? minimisedHeight : minimisedWidth;
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+
4
+ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
5
+
6
+ import { Spinner } from "../Spinner";
7
+
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ ...StyleSheet.absoluteFillObject,
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ },
14
+ });
15
+
16
+ export const OpaqueLayer = () => {
17
+ const theme = useTheme();
18
+
19
+ return (
20
+ <View
21
+ style={[
22
+ styles.container,
23
+ {
24
+ // we assume that it's non-transparent and we could show spinner always until it will be covered by player
25
+ // this spinner hides all content under modal
26
+ backgroundColor: theme?.app_background_color,
27
+ },
28
+ ]}
29
+ >
30
+ <Spinner />
31
+ </View>
32
+ );
33
+ };
@@ -4,6 +4,7 @@ import {
4
4
  ViewStyle,
5
5
  Animated,
6
6
  Easing,
7
+ StyleSheet,
7
8
  Dimensions,
8
9
  } from "react-native";
9
10
  import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
@@ -90,7 +91,9 @@ export const PlayerDetails = ({
90
91
  {
91
92
  // workaround for avoid wrong text-height after going back to portrait rotation
92
93
  // we don't see this view in landscape mode, so we are able to use fixed width from portrait mode
93
- width: isTablet ? undefined : SCREEN_WIDTH,
94
+ width: isTablet
95
+ ? undefined
96
+ : (StyleSheet.flatten(style)?.width ?? SCREEN_WIDTH),
94
97
  },
95
98
  ]}
96
99
  >
@@ -10,7 +10,8 @@ import { Edge, SafeAreaView } from "react-native-safe-area-context";
10
10
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
11
11
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
12
12
  import { PlayerDetails } from "./PlayerDetails";
13
- import { playerDimesionsHack } from "./utils";
13
+ import { playerDimensionsHack } from "./utils";
14
+ import { useDelayedPlayerDetails } from "./hooks";
14
15
 
15
16
  import {
16
17
  AnimatedScrollModal,
@@ -121,34 +122,6 @@ const getTabletWidth = (
121
122
  return Number(width) - sidebarWidth;
122
123
  };
123
124
 
124
- const showDetails = (
125
- isMobile: boolean,
126
- docked: boolean,
127
- isInlineModal,
128
- pip
129
- ): boolean => {
130
- if (pip) {
131
- return false;
132
- }
133
-
134
- if (!isInlineModal) {
135
- return false;
136
- }
137
-
138
- // for mobile we always show details. Mounting of it very heavy operation.
139
- if (isMobile) {
140
- return true;
141
- }
142
-
143
- // workaround for tablets we need to mount/unmount in order to avoid PlayerDetails content dissappearing
144
- // FIXME - find out the reason of dissapearing of content
145
- if (docked) {
146
- return false;
147
- }
148
-
149
- return true;
150
- };
151
-
152
125
  const PlayerWrapperComponent = (props: Props) => {
153
126
  const {
154
127
  entry,
@@ -167,7 +140,15 @@ const PlayerWrapperComponent = (props: Props) => {
167
140
 
168
141
  const isInlineModal = inline && isModal;
169
142
 
170
- // const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
143
+ // Mounting the PlayerDetails component is a resource-intensive process.
144
+ // Therefore, for performance reasons, we mount it with a delay to make the rotation process as smooth as possible.
145
+ // The flow is as follows: the rotation occurs first, and then, after a short delay, we mount the PlayerDetails component.
146
+ // This helps to avoid blocking the rotation and any animations related to the rotation.
147
+ const isShowPlayerDetails = useDelayedPlayerDetails({
148
+ isInline: isInlineModal,
149
+ isDocked: docked,
150
+ isPip: pip,
151
+ });
171
152
 
172
153
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
173
154
 
@@ -203,8 +184,8 @@ const PlayerWrapperComponent = (props: Props) => {
203
184
  const WrapperView = React.useMemo(() => (isTV() ? View : SafeAreaView), []);
204
185
 
205
186
  const childrenStyles = React.useMemo(
206
- () => ({ ...playerDimensions, ...playerDimesionsHack }),
207
- [containerDimensions, playerDimesionsHack]
187
+ () => ({ ...playerDimensions, ...playerDimensionsHack }),
188
+ [containerDimensions, playerDimensionsHack]
208
189
  );
209
190
 
210
191
  return (
@@ -213,7 +194,7 @@ const PlayerWrapperComponent = (props: Props) => {
213
194
  style={[
214
195
  safeAreaStyles(configuration, isTablet),
215
196
  style,
216
- playerDimesionsHack,
197
+ playerDimensionsHack,
217
198
  ]}
218
199
  >
219
200
  <AnimationComponent
@@ -227,7 +208,7 @@ const PlayerWrapperComponent = (props: Props) => {
227
208
  defaultStyles.playerContainer,
228
209
  containerDimensions,
229
210
  containerStyle,
230
- playerDimesionsHack,
211
+ playerDimensionsHack,
231
212
  ]}
232
213
  >
233
214
  <AnimationComponent
@@ -246,7 +227,7 @@ const PlayerWrapperComponent = (props: Props) => {
246
227
  </View>
247
228
 
248
229
  <AnimatedScrollModal>
249
- {showDetails(!isTablet, docked, isInlineModal, pip) && (
230
+ {isShowPlayerDetails && (
250
231
  <AnimationComponent
251
232
  animationType={ComponentAnimationType.componentFade}
252
233
  style={defaultStyles.flex}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import * as R from "ramda";
3
- import { StyleSheet, View, StatusBar } from "react-native";
2
+ import { equals } from "ramda";
3
+ import { StyleSheet, StatusBar } from "react-native";
4
4
 
5
5
  import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
6
6
  import {
@@ -17,17 +17,20 @@ import {
17
17
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks/device/useIsTablet";
18
18
 
19
19
  import { withModalNavigationContextProvider } from "../../Contexts/ModalNavigationContext";
20
- import { useModalSize } from "./hooks/useModalSize";
21
- import { useBackgroundColor } from "./hooks/useBackgroundColor";
22
- import { useInitialPlayerState } from "./hooks/useInitialPlayerState";
20
+ import {
21
+ useModalSize,
22
+ useBackgroundColor,
23
+ useInitialPlayerState,
24
+ } from "./hooks";
25
+
23
26
  import { APP_EVENTS } from "@applicaster/zapp-react-native-utils/appUtils/events";
24
- import { Spinner } from "../Spinner";
25
27
  import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
26
28
  import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
27
29
  import { useSubscriberFor } from "@applicaster/zapp-react-native-utils/reactHooks/useSubscriberFor";
28
30
  import { requiresAuthentication } from "@applicaster/zapp-react-native-utils/configurationUtils";
29
31
  import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
30
32
  import { ScreenContextProvider } from "../../Contexts/ScreenContext";
33
+ import { OpaqueLayer } from "./OpaqueLayer";
31
34
 
32
35
  import { AnimatedPlayerModalWrapper } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
33
36
 
@@ -39,17 +42,6 @@ const styles = StyleSheet.create({
39
42
  bottom: 0,
40
43
  position: "absolute",
41
44
  },
42
- // eslint-disable-next-line react-native/no-color-literals
43
- loaderContainer: {
44
- top: 0,
45
- left: 0,
46
- right: 0,
47
- bottom: 0,
48
- position: "absolute",
49
- alignItems: "center",
50
- justifyContent: "center",
51
- backgroundColor: "rgba(64,64,64,.5)",
52
- },
53
45
  });
54
46
 
55
47
  const VideoModalComponent = () => {
@@ -100,7 +92,7 @@ const VideoModalComponent = () => {
100
92
 
101
93
  const onHooksSuccess = ({ payload }) => {
102
94
  // set new modified entry
103
- if (!R.equals(payload, item)) {
95
+ if (!equals(payload, item)) {
104
96
  onVideoModalHookSuccessAnalyticsEvent();
105
97
  setVideoModalItem(payload);
106
98
  }
@@ -136,7 +128,10 @@ const VideoModalComponent = () => {
136
128
 
137
129
  <PathnameContext.Provider value={pathname}>
138
130
  <ScreenContextProvider pathname={pathname}>
139
- {itemIdHooksFinished === item?.id ? (
131
+ {/* Hide content underneath when we switch to next video in fullscreen mode */}
132
+ {mode === "FULLSCREEN" && <OpaqueLayer />}
133
+
134
+ {itemIdHooksFinished === item?.id && (
140
135
  <AnimatedPlayerModalWrapper
141
136
  style={[
142
137
  styles.container,
@@ -153,10 +148,6 @@ const VideoModalComponent = () => {
153
148
  mode={mode}
154
149
  />
155
150
  </AnimatedPlayerModalWrapper>
156
- ) : (
157
- <View style={styles.loaderContainer}>
158
- <Spinner />
159
- </View>
160
151
  )}
161
152
  </ScreenContextProvider>
162
153
  </PathnameContext.Provider>
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import renderer from "react-test-renderer";
3
- import { View } from "react-native";
4
3
 
5
4
  const props = {
6
5
  entry: {},
@@ -24,7 +23,11 @@ jest.mock("react-native-safe-area-context", () => ({
24
23
 
25
24
  jest.mock(
26
25
  "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap",
27
- () => ({ ComponentsMap: View })
26
+ () => {
27
+ const View = jest.requireActual("react-native").View;
28
+
29
+ return { ComponentsMap: View };
30
+ }
28
31
  );
29
32
 
30
33
  jest.mock("@applicaster/zapp-react-native-utils/reactHooks/screen", () => ({
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
2
 
3
- import { View } from "react-native";
4
-
5
3
  import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
6
4
 
7
5
  const props = {
@@ -17,13 +15,17 @@ const props = {
17
15
  },
18
16
  };
19
17
 
20
- const useIsTablet = jest.fn();
18
+ const mockUseIsDeviceTablet = jest.fn();
21
19
 
22
20
  jest.mock("react-native");
23
21
 
24
22
  jest.mock("react-native-gesture-handler");
25
23
 
26
- jest.mock("../PlayerDetails", () => ({ PlayerDetails: View }));
24
+ jest.mock("../PlayerDetails", () => {
25
+ const View = jest.requireActual("react-native").View;
26
+
27
+ return { PlayerDetails: View };
28
+ });
27
29
 
28
30
  jest.mock(
29
31
  "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext",
@@ -33,10 +35,11 @@ jest.mock(
33
35
  );
34
36
 
35
37
  jest.mock("@applicaster/zapp-react-native-utils/reactHooks/device", () => ({
36
- useIsTablet,
38
+ useIsTablet: mockUseIsDeviceTablet,
37
39
  }));
38
40
 
39
41
  jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
42
+ ...jest.requireActual("@applicaster/zapp-react-native-utils/theme"),
40
43
  useTheme: jest.fn(() => ({})),
41
44
  }));
42
45
 
@@ -59,7 +62,7 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
59
62
  })),
60
63
  }));
61
64
 
62
- jest.mock("../utils", () => ({ playerDimesionsHack: {} }));
65
+ jest.mock("../utils", () => ({ playerDimensionsHack: {} }));
63
66
 
64
67
  const { PlayerWrapper } = require("../PlayerWrapper");
65
68
 
@@ -68,7 +71,7 @@ const children = jest.fn(() => {});
68
71
 
69
72
  describe("PlayerWrapper", () => {
70
73
  it("renders properly", () => {
71
- useIsTablet.mockReturnValue(false);
74
+ mockUseIsDeviceTablet.mockReturnValue(false);
72
75
 
73
76
  const element = renderWithProviders(
74
77
  <PlayerWrapper {...props}>{children}</PlayerWrapper>
@@ -78,7 +81,7 @@ describe("PlayerWrapper", () => {
78
81
  });
79
82
 
80
83
  it("renders inline", () => {
81
- useIsTablet.mockReturnValue(false);
84
+ mockUseIsDeviceTablet.mockReturnValue(false);
82
85
 
83
86
  const element = renderWithProviders(
84
87
  <PlayerWrapper {...props} inline={true} isModal={true}>
@@ -90,7 +93,7 @@ describe("PlayerWrapper", () => {
90
93
  });
91
94
 
92
95
  it("renders inline on tablet in landscape orientation", () => {
93
- useIsTablet.mockReturnValue(true);
96
+ mockUseIsDeviceTablet.mockReturnValue(true);
94
97
 
95
98
  const element = renderWithProviders(
96
99
  <PlayerWrapper {...props} inline={true} isModal={true}>
@@ -102,7 +105,7 @@ describe("PlayerWrapper", () => {
102
105
  });
103
106
 
104
107
  it("renders inline and docked", () => {
105
- useIsTablet.mockReturnValue(false);
108
+ mockUseIsDeviceTablet.mockReturnValue(false);
106
109
 
107
110
  const children = jest.fn(() => {});
108
111
  const dimensions = { height: undefined, width: props.style.width };
@@ -4,7 +4,7 @@ exports[`PlayerDetails renders properly 1`] = `
4
4
  <View
5
5
  collapsable={false}
6
6
  style={
7
- Object {
7
+ {
8
8
  "backgroundColor": "transparent",
9
9
  "flex": 1,
10
10
  "marginTop": -8,
@@ -15,7 +15,7 @@ exports[`PlayerDetails renders properly 1`] = `
15
15
  >
16
16
  <View
17
17
  feed="test-source"
18
- riverComponents={Array []}
18
+ riverComponents={[]}
19
19
  riverId="test-id"
20
20
  />
21
21
  </View>
@@ -25,7 +25,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
25
25
  <View
26
26
  collapsable={false}
27
27
  style={
28
- Object {
28
+ {
29
29
  "backgroundColor": "transparent",
30
30
  "flex": 1,
31
31
  "marginTop": -20,
@@ -36,7 +36,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
36
36
  >
37
37
  <View
38
38
  feed="test-source"
39
- riverComponents={Array []}
39
+ riverComponents={[]}
40
40
  riverId="test-id"
41
41
  />
42
42
  </View>