@applicaster/zapp-react-native-ui-components 12.0.0-rc.98 → 13.0.0-alpha.2322412833
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/Components/Cell/Cell.tsx +33 -18
- package/Components/Cell/CellWithFocusable.tsx +1 -1
- package/Components/Cell/TvOSCellComponent.tsx +3 -4
- package/Components/Focusable/__tests__/index.android.test.tsx +72 -0
- package/Components/Focusable/index.android.tsx +15 -9
- package/Components/FocusableList/FocusableChild.ts +2 -2
- package/Components/FocusableList/index.tsx +11 -12
- package/Components/FocusableScrollView/index.tsx +1 -1
- package/Components/FreezeWithCallback/Freeze.tsx +31 -0
- package/Components/FreezeWithCallback/LICENSE +21 -0
- package/Components/FreezeWithCallback/Suspender.tsx +17 -0
- package/Components/FreezeWithCallback/__tests__/index.test.tsx +170 -0
- package/Components/FreezeWithCallback/index.tsx +3 -0
- package/Components/Image/Image.android.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +12 -7
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +1 -7
- package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +6 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +12 -0
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +6 -5
- package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +2 -2
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/index.ts +71 -0
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/index.ts +2 -0
- package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +7 -1
- package/Components/MasterCell/dataAdapter.ts +21 -7
- package/Components/MasterCell/index.tsx +5 -3
- package/Components/MasterCell/utils/index.ts +3 -4
- package/Components/NativeFocusables/{index.js → index.ts} +4 -2
- package/Components/PlayerContainer/PlayerContainer.tsx +14 -8
- package/Components/Screen/TV/hooks/index.ts +0 -2
- package/Components/Screen/TV/index.web.tsx +32 -19
- package/Components/Screen/__tests__/Screen.test.tsx +0 -49
- package/Components/Screen/index.tsx +2 -20
- package/Components/Screen/navigationHandler.ts +1 -3
- package/Components/Screen/orientationHandler.ts +18 -7
- package/Components/Screen/utils.ts +16 -0
- package/Components/ScreenResolver/index.tsx +6 -11
- package/Components/Transitioner/Scene.tsx +9 -2
- package/Components/Transitioner/Transitioner.tsx +38 -23
- package/Components/Transitioner/__tests__/Scene.test.js +7 -0
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +1 -0
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +52 -24
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +31 -24
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +3 -9
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +87 -41
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +20 -9
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +41 -22
- package/Components/VideoModal/PlayerDetails.tsx +16 -2
- package/Components/VideoModal/PlayerWrapper.tsx +101 -67
- package/Components/VideoModal/VideoModal.tsx +33 -27
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +7 -0
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +2 -0
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +78 -16
- package/Components/ZappFrameworkComponents/BarView/BarView.tsx +7 -3
- package/Components/ZappFrameworkComponents/BarView/Buttons/BackButton.tsx +7 -2
- package/Components/ZappFrameworkComponents/BarView/Buttons/CloseButton.tsx +7 -2
- package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +87 -0
- package/Components/ZappFrameworkComponents/Buttons/ActionButton.tsx +9 -4
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +4 -4
- package/Contexts/CachedDimensionsContext/index.ts +13 -9
- package/Contexts/ConfirmDialogState/index.ts +1 -1
- package/Contexts/ScreenContext/index.tsx +6 -1
- package/Decorators/Analytics/{index.js → index.tsx} +11 -11
- package/README.md +1 -13
- package/const.ts +6 -0
- package/index.js +3 -0
- package/package.json +5 -5
- package/Components/Screen/TV/hooks/useRestoreFocus.ts +0 -22
|
@@ -37,14 +37,22 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
37
37
|
setStartComponentsAnimation,
|
|
38
38
|
} = useModalAnimationContext();
|
|
39
39
|
|
|
40
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
videoModalState: { mode: videoModalMode },
|
|
42
|
+
} = useNavigation();
|
|
43
|
+
|
|
41
44
|
const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
|
|
45
|
+
const isMaximazedModal = videoModalMode === "MAXIMIZED";
|
|
46
|
+
const isMinimizedModal = videoModalMode === "MINIMIZED";
|
|
42
47
|
|
|
43
|
-
const
|
|
44
|
-
|
|
48
|
+
const isNotMinimizeMaximazeAnimation =
|
|
49
|
+
playerAnimationState !== PlayerAnimationStateEnum.minimize &&
|
|
50
|
+
playerAnimationState !== PlayerAnimationStateEnum.maximaze;
|
|
45
51
|
|
|
46
52
|
const isEnablePanGesture =
|
|
47
|
-
!isLanguageOverlayVisible &&
|
|
53
|
+
!isLanguageOverlayVisible &&
|
|
54
|
+
isNotMinimizeMaximazeAnimation &&
|
|
55
|
+
(isMaximazedModal || isMinimizedModal);
|
|
48
56
|
|
|
49
57
|
const onGestureEvent = Animated.event(
|
|
50
58
|
[{ nativeEvent: { translationY: dragVideoPlayerY } }],
|
|
@@ -59,7 +67,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
59
67
|
const preparedTranslationY = Math.abs(translationY);
|
|
60
68
|
const dragToss = 0.05;
|
|
61
69
|
|
|
62
|
-
if (
|
|
70
|
+
if (videoModalMode === "MAXIMIZED") {
|
|
63
71
|
if (translationY > 0) {
|
|
64
72
|
const endOffsetY =
|
|
65
73
|
lastSnap + preparedTranslationY + dragToss * velocityY + 200;
|
|
@@ -84,7 +92,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
84
92
|
setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
|
-
} else if (
|
|
95
|
+
} else if (videoModalMode === "MINIMIZED") {
|
|
88
96
|
if (translationY < 0) {
|
|
89
97
|
// from mini to full
|
|
90
98
|
setLastSnap(modalSnapPoints[0]);
|
|
@@ -100,7 +108,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
},
|
|
103
|
-
[lastSnap, modalSnapPoints,
|
|
111
|
+
[lastSnap, modalSnapPoints, videoModalMode]
|
|
104
112
|
);
|
|
105
113
|
|
|
106
114
|
React.useEffect(() => {
|
|
@@ -145,7 +153,6 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
145
153
|
return (
|
|
146
154
|
<PanGestureHandler
|
|
147
155
|
enabled={isEnablePanGesture}
|
|
148
|
-
shouldCancelWhenOutside={isMaximazedModal}
|
|
149
156
|
onGestureEvent={onGestureEvent}
|
|
150
157
|
onHandlerStateChange={onHandlerStateChange}
|
|
151
158
|
>
|
|
@@ -155,7 +162,11 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
155
162
|
};
|
|
156
163
|
|
|
157
164
|
export const AnimatedVideoPlayerComponent = ({ children }: Props) => {
|
|
158
|
-
const
|
|
165
|
+
const {
|
|
166
|
+
videoModalState: { visible },
|
|
167
|
+
} = useNavigation();
|
|
168
|
+
|
|
169
|
+
const Component = !isTV() && visible ? AnimatedVideoPlayer : React.Fragment;
|
|
159
170
|
|
|
160
171
|
return <Component>{children}</Component>;
|
|
161
172
|
};
|
|
@@ -60,9 +60,14 @@ export const AnimationView = ({
|
|
|
60
60
|
const {
|
|
61
61
|
width: screenWidth,
|
|
62
62
|
deviceInfo: { isTablet, isTabletLandscape },
|
|
63
|
-
} = useDimensions("window", {
|
|
63
|
+
} = useDimensions("window", {
|
|
64
|
+
deviceInfo: true,
|
|
65
|
+
updateForInactiveScreens: true,
|
|
66
|
+
});
|
|
64
67
|
|
|
65
68
|
const { videoModalState } = useNavigation();
|
|
69
|
+
const { mode: videoModalMode, item: videoModalItem } = videoModalState;
|
|
70
|
+
|
|
66
71
|
const insets = useSafeAreaInsets();
|
|
67
72
|
const bottomTabBarHeight = useGetBottomTabBarHeight() + (insets.bottom || 0);
|
|
68
73
|
const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
|
|
@@ -85,9 +90,9 @@ export const AnimationView = ({
|
|
|
85
90
|
|
|
86
91
|
const isAudioItem = React.useMemo(
|
|
87
92
|
() =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
[
|
|
93
|
+
videoModalItem?.content?.type?.includes?.("audio") ||
|
|
94
|
+
videoModalItem?.type?.value === "audio",
|
|
95
|
+
[videoModalItem]
|
|
91
96
|
);
|
|
92
97
|
|
|
93
98
|
const inlineAudioPlayer = additionalData.inlineAudioPlayer;
|
|
@@ -226,10 +231,8 @@ export const AnimationView = ({
|
|
|
226
231
|
);
|
|
227
232
|
|
|
228
233
|
const getInitialValue = React.useCallback(() => {
|
|
229
|
-
const mode =
|
|
230
|
-
|
|
231
|
-
? videoModalState.previousMode
|
|
232
|
-
: videoModalState.mode;
|
|
234
|
+
const { mode: videoModalMode, previousMode } = videoModalState;
|
|
235
|
+
const mode = videoModalMode === "PIP" ? previousMode : videoModalMode;
|
|
233
236
|
|
|
234
237
|
switch (mode) {
|
|
235
238
|
case "MINIMIZED":
|
|
@@ -263,7 +266,7 @@ export const AnimationView = ({
|
|
|
263
266
|
isTablet,
|
|
264
267
|
isTabletLandscape,
|
|
265
268
|
isRTL,
|
|
266
|
-
fromMiniPlayer:
|
|
269
|
+
fromMiniPlayer: videoModalMode === "MINIMIZED",
|
|
267
270
|
inlineAudioPlayer,
|
|
268
271
|
}),
|
|
269
272
|
[
|
|
@@ -273,7 +276,7 @@ export const AnimationView = ({
|
|
|
273
276
|
defaultValue,
|
|
274
277
|
moveUpValue,
|
|
275
278
|
moveComponentHorizontalValue,
|
|
276
|
-
|
|
279
|
+
videoModalMode,
|
|
277
280
|
]
|
|
278
281
|
);
|
|
279
282
|
|
|
@@ -301,19 +304,40 @@ export const AnimationView = ({
|
|
|
301
304
|
typeof additionalData.height === "number" && additionalData.height;
|
|
302
305
|
}
|
|
303
306
|
|
|
304
|
-
if (
|
|
307
|
+
if (
|
|
308
|
+
videoModalMode === "MAXIMIZED" &&
|
|
309
|
+
defaultValue.x !== screenWidth &&
|
|
310
|
+
width &&
|
|
311
|
+
height
|
|
312
|
+
) {
|
|
305
313
|
const value = { x: width, y: height };
|
|
306
314
|
setDefaultValue(value);
|
|
307
315
|
animatedValue.setValue(value);
|
|
308
316
|
}
|
|
309
317
|
}
|
|
310
|
-
}, [
|
|
318
|
+
}, [screenWidth]);
|
|
319
|
+
|
|
320
|
+
React.useEffect(() => {
|
|
321
|
+
const { mode, previousMode } = videoModalState;
|
|
322
|
+
|
|
323
|
+
if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
|
|
324
|
+
// set animation to the minimize values if moving from the player to another screen
|
|
325
|
+
if (playerAnimationState === null) {
|
|
326
|
+
const value = getAnimationValue(
|
|
327
|
+
animationType,
|
|
328
|
+
PlayerAnimationStateEnum.minimize
|
|
329
|
+
).toValue;
|
|
330
|
+
|
|
331
|
+
animatedValue.setValue(value);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}, [videoModalState]);
|
|
311
335
|
|
|
312
336
|
React.useEffect(() => {
|
|
313
337
|
if (
|
|
314
338
|
playerAnimationState === PlayerAnimationStateEnum.minimize &&
|
|
315
339
|
startComponentsAnimation &&
|
|
316
|
-
|
|
340
|
+
videoModalMode === "MAXIMIZED"
|
|
317
341
|
) {
|
|
318
342
|
Animated.timing(
|
|
319
343
|
animatedValue,
|
|
@@ -322,12 +346,7 @@ export const AnimationView = ({
|
|
|
322
346
|
} else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
|
|
323
347
|
animatedValue.setValue(defaultValue);
|
|
324
348
|
}
|
|
325
|
-
}, [
|
|
326
|
-
playerAnimationState,
|
|
327
|
-
startComponentsAnimation,
|
|
328
|
-
videoModalState.mode,
|
|
329
|
-
defaultValue,
|
|
330
|
-
]);
|
|
349
|
+
}, [playerAnimationState, startComponentsAnimation, defaultValue]);
|
|
331
350
|
|
|
332
351
|
React.useEffect(() => {
|
|
333
352
|
const dragVideoPlayerYListenerId = dragVideoPlayerY.addListener(
|
|
@@ -389,9 +408,9 @@ export const AnimationView = ({
|
|
|
389
408
|
ref={animationComponentRef}
|
|
390
409
|
style={[
|
|
391
410
|
...preparedStyles,
|
|
392
|
-
(
|
|
393
|
-
|
|
394
|
-
(
|
|
411
|
+
(videoModalMode === "MAXIMIZED" ||
|
|
412
|
+
videoModalMode === "MINIMIZED" ||
|
|
413
|
+
(videoModalMode === "PIP" && isAppActive)) &&
|
|
395
414
|
getAnimationStyle(animationType, animatedValue),
|
|
396
415
|
]}
|
|
397
416
|
>
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleProp,
|
|
4
|
+
ViewStyle,
|
|
5
|
+
Animated,
|
|
6
|
+
Easing,
|
|
7
|
+
Dimensions,
|
|
8
|
+
} from "react-native";
|
|
3
9
|
import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
|
|
4
10
|
import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
|
|
5
11
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
12
|
|
|
13
|
+
const { width: SCREEN_WIDTH } = Dimensions.get("screen");
|
|
14
|
+
|
|
7
15
|
type Configuration = {
|
|
8
16
|
[key: string]: any;
|
|
9
17
|
modal_background_color?: string;
|
|
@@ -15,6 +23,7 @@ type Props = {
|
|
|
15
23
|
configuration: Configuration;
|
|
16
24
|
isTabletLandscape: boolean;
|
|
17
25
|
isAudioPlayer?: boolean;
|
|
26
|
+
isTablet: boolean;
|
|
18
27
|
};
|
|
19
28
|
|
|
20
29
|
const containerStyle = ({
|
|
@@ -31,6 +40,7 @@ export const PlayerDetails = ({
|
|
|
31
40
|
configuration,
|
|
32
41
|
isTabletLandscape,
|
|
33
42
|
isAudioPlayer,
|
|
43
|
+
isTablet,
|
|
34
44
|
}: Props) => {
|
|
35
45
|
const screenData = useTargetScreenData(entry);
|
|
36
46
|
const insets = useSafeAreaInsets();
|
|
@@ -77,7 +87,11 @@ export const PlayerDetails = ({
|
|
|
77
87
|
transform: [{ translateY }],
|
|
78
88
|
opacity,
|
|
79
89
|
},
|
|
80
|
-
|
|
90
|
+
{
|
|
91
|
+
// workaround for avoid wrong text-height after going back to portrait rotation
|
|
92
|
+
// 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
|
+
},
|
|
81
95
|
]}
|
|
82
96
|
>
|
|
83
97
|
{screenData && (
|
|
@@ -7,14 +7,10 @@ import {
|
|
|
7
7
|
ViewStyle,
|
|
8
8
|
} from "react-native";
|
|
9
9
|
import { Edge, SafeAreaView } from "react-native-safe-area-context";
|
|
10
|
-
|
|
11
10
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
12
11
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
13
12
|
import { PlayerDetails } from "./PlayerDetails";
|
|
14
13
|
import { playerDimesionsHack } from "./utils";
|
|
15
|
-
import { PathnameContext } from "../../Contexts/PathnameContext";
|
|
16
|
-
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
17
|
-
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
18
14
|
|
|
19
15
|
import {
|
|
20
16
|
AnimatedScrollModal,
|
|
@@ -23,6 +19,8 @@ import {
|
|
|
23
19
|
ComponentAnimationType,
|
|
24
20
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
25
21
|
|
|
22
|
+
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
|
|
23
|
+
|
|
26
24
|
type DimensionsT = {
|
|
27
25
|
width: number | string;
|
|
28
26
|
height: number | string | undefined;
|
|
@@ -69,10 +67,8 @@ const directionStyles = (isTabletLandscape: boolean): ViewStyle => {
|
|
|
69
67
|
};
|
|
70
68
|
|
|
71
69
|
const getScreenAspectRatio = () => {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const longEdge = Math.max(width, height);
|
|
75
|
-
const shortEdge = Math.min(width, height);
|
|
70
|
+
const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
71
|
+
const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
76
72
|
|
|
77
73
|
return longEdge / shortEdge;
|
|
78
74
|
};
|
|
@@ -125,10 +121,54 @@ const getTabletWidth = (
|
|
|
125
121
|
return Number(width) - sidebarWidth;
|
|
126
122
|
};
|
|
127
123
|
|
|
128
|
-
|
|
124
|
+
const getStyles = (baseStyle, isMobile, isPortrait, pip) => {
|
|
125
|
+
if (pip) {
|
|
126
|
+
return baseStyle;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (isMobile && isPortrait) {
|
|
130
|
+
return { width: SCREEN_WIDTH, height: SCREEN_HEIGHT };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (isMobile && !isPortrait) {
|
|
134
|
+
return { width: SCREEN_HEIGHT, height: SCREEN_WIDTH };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return baseStyle;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const showDetails = (
|
|
141
|
+
isMobile: boolean,
|
|
142
|
+
docked: boolean,
|
|
143
|
+
isInlineModal,
|
|
144
|
+
pip
|
|
145
|
+
): boolean => {
|
|
146
|
+
if (pip) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (!isInlineModal) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// for mobile we always show details. Mounting of it very heavy operation.
|
|
155
|
+
if (isMobile) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// workaround for tablets we need to mount/unmount in order to avoid PlayerDetails content dissappearing
|
|
160
|
+
// FIXME - find out the reason of dissapearing of content
|
|
161
|
+
if (docked) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return true;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const PlayerWrapperComponent = (props: Props) => {
|
|
129
169
|
const {
|
|
130
170
|
entry,
|
|
131
|
-
style,
|
|
171
|
+
style: baseStyle,
|
|
132
172
|
containerStyle,
|
|
133
173
|
inline,
|
|
134
174
|
docked,
|
|
@@ -143,6 +183,8 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
143
183
|
|
|
144
184
|
const isInlineModal = inline && isModal;
|
|
145
185
|
|
|
186
|
+
const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
187
|
+
|
|
146
188
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
147
189
|
|
|
148
190
|
const tabletWidth = getTabletWidth(configuration, style);
|
|
@@ -181,71 +223,63 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
181
223
|
[containerDimensions, playerDimesionsHack]
|
|
182
224
|
);
|
|
183
225
|
|
|
184
|
-
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${entry?.id}`;
|
|
185
|
-
|
|
186
226
|
return (
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
227
|
+
<WrapperView
|
|
228
|
+
edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
|
|
229
|
+
style={[
|
|
230
|
+
safeAreaStyles(configuration, isTablet),
|
|
231
|
+
style,
|
|
232
|
+
playerDimesionsHack,
|
|
233
|
+
]}
|
|
234
|
+
>
|
|
235
|
+
<AnimationComponent
|
|
236
|
+
animationType={ComponentAnimationType.moveUpComponent}
|
|
237
|
+
additionalData={{ saveArea: true }}
|
|
238
|
+
style={[directionStyles(isTabletLandscape), defaultStyles.flex]}
|
|
239
|
+
>
|
|
240
|
+
<View
|
|
241
|
+
testID={`${entry?.id}-player-container`}
|
|
191
242
|
style={[
|
|
192
|
-
|
|
193
|
-
|
|
243
|
+
defaultStyles.playerContainer,
|
|
244
|
+
containerDimensions,
|
|
245
|
+
containerStyle,
|
|
194
246
|
playerDimesionsHack,
|
|
195
247
|
]}
|
|
196
248
|
>
|
|
197
249
|
<AnimationComponent
|
|
198
250
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
199
|
-
|
|
200
|
-
|
|
251
|
+
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
252
|
+
additionalData={{
|
|
253
|
+
useLayoutMeasure: isTabletLandscape,
|
|
254
|
+
disableAnimatedComponent: !isTabletLandscape,
|
|
255
|
+
resetAnimationValue: isTabletLandscape && docked,
|
|
256
|
+
}}
|
|
201
257
|
>
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
testID={`${entry?.id}-player-container`}
|
|
206
|
-
style={[
|
|
207
|
-
defaultStyles.playerContainer,
|
|
208
|
-
containerDimensions,
|
|
209
|
-
containerStyle,
|
|
210
|
-
playerDimesionsHack,
|
|
211
|
-
]}
|
|
212
|
-
>
|
|
213
|
-
<AnimationComponent
|
|
214
|
-
animationType={ComponentAnimationType.moveUpComponent}
|
|
215
|
-
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
216
|
-
additionalData={{
|
|
217
|
-
useLayoutMeasure: isTabletLandscape,
|
|
218
|
-
disableAnimatedComponent: !isTabletLandscape,
|
|
219
|
-
resetAnimationValue: isTabletLandscape && docked,
|
|
220
|
-
}}
|
|
221
|
-
>
|
|
222
|
-
<AnimatedVideoPlayerComponent>
|
|
223
|
-
{children(childrenStyles)}
|
|
224
|
-
</AnimatedVideoPlayerComponent>
|
|
225
|
-
</AnimationComponent>
|
|
226
|
-
</View>
|
|
227
|
-
<AnimatedScrollModal>
|
|
228
|
-
{isInlineModal && !docked ? (
|
|
229
|
-
<AnimationComponent
|
|
230
|
-
animationType={ComponentAnimationType.componentFade}
|
|
231
|
-
style={defaultStyles.flex}
|
|
232
|
-
>
|
|
233
|
-
<PlayerDetails
|
|
234
|
-
configuration={configuration}
|
|
235
|
-
style={defaultStyles.playerDetails}
|
|
236
|
-
entry={entry}
|
|
237
|
-
isTabletLandscape={isTabletLandscape}
|
|
238
|
-
/>
|
|
239
|
-
</AnimationComponent>
|
|
240
|
-
) : (
|
|
241
|
-
<View style={defaultStyles.playerDetails} />
|
|
242
|
-
)}
|
|
243
|
-
</AnimatedScrollModal>
|
|
244
|
-
</ScreenContextProvider>
|
|
245
|
-
</PathnameContext.Provider>
|
|
258
|
+
<AnimatedVideoPlayerComponent>
|
|
259
|
+
{children(childrenStyles)}
|
|
260
|
+
</AnimatedVideoPlayerComponent>
|
|
246
261
|
</AnimationComponent>
|
|
247
|
-
</
|
|
248
|
-
|
|
249
|
-
|
|
262
|
+
</View>
|
|
263
|
+
|
|
264
|
+
<AnimatedScrollModal>
|
|
265
|
+
{showDetails(!isTablet, docked, isInlineModal, pip) && (
|
|
266
|
+
<AnimationComponent
|
|
267
|
+
animationType={ComponentAnimationType.componentFade}
|
|
268
|
+
style={defaultStyles.flex}
|
|
269
|
+
>
|
|
270
|
+
<PlayerDetails
|
|
271
|
+
configuration={configuration}
|
|
272
|
+
style={defaultStyles.playerDetails}
|
|
273
|
+
entry={entry}
|
|
274
|
+
isTabletLandscape={isTabletLandscape}
|
|
275
|
+
isTablet={isTablet}
|
|
276
|
+
/>
|
|
277
|
+
</AnimationComponent>
|
|
278
|
+
)}
|
|
279
|
+
</AnimatedScrollModal>
|
|
280
|
+
</AnimationComponent>
|
|
281
|
+
</WrapperView>
|
|
250
282
|
);
|
|
251
283
|
};
|
|
284
|
+
|
|
285
|
+
export const PlayerWrapper = PlayerWrapperComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { StyleSheet, View, StatusBar } from "react-native";
|
|
4
4
|
|
|
5
5
|
import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
|
|
6
6
|
import {
|
|
@@ -129,32 +129,38 @@ const VideoModalComponent = () => {
|
|
|
129
129
|
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${item?.id}`;
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
132
|
+
<>
|
|
133
|
+
{/* TODO: Workaround to avoid unnecessary UI effect when switching from portrait to fullscreen */}
|
|
134
|
+
<StatusBar hidden={false} />
|
|
135
|
+
{/* TODO: Workaround to avoid unnecessary UI effect when switching from portrait to fullscreen */}
|
|
136
|
+
|
|
137
|
+
<PathnameContext.Provider value={pathname}>
|
|
138
|
+
<ScreenContextProvider pathname={pathname}>
|
|
139
|
+
{itemIdHooksFinished === item?.id ? (
|
|
140
|
+
<AnimatedPlayerModalWrapper
|
|
141
|
+
style={[
|
|
142
|
+
styles.container,
|
|
143
|
+
{
|
|
144
|
+
backgroundColor,
|
|
145
|
+
},
|
|
146
|
+
]}
|
|
147
|
+
>
|
|
148
|
+
<HandlePlayable
|
|
149
|
+
item={item}
|
|
150
|
+
isModal={mode !== "PIP"}
|
|
151
|
+
modalHeight={modalSize.height}
|
|
152
|
+
modalWidth={modalSize.width}
|
|
153
|
+
mode={mode}
|
|
154
|
+
/>
|
|
155
|
+
</AnimatedPlayerModalWrapper>
|
|
156
|
+
) : (
|
|
157
|
+
<View style={styles.loaderContainer}>
|
|
158
|
+
<Spinner />
|
|
159
|
+
</View>
|
|
160
|
+
)}
|
|
161
|
+
</ScreenContextProvider>
|
|
162
|
+
</PathnameContext.Provider>
|
|
163
|
+
</>
|
|
158
164
|
);
|
|
159
165
|
};
|
|
160
166
|
|
|
@@ -8,6 +8,13 @@ const props = {
|
|
|
8
8
|
configuration: { modal_background_color: "transparent" },
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/layout", () => ({
|
|
12
|
+
useDimensions: jest.fn(() => ({
|
|
13
|
+
width: 20,
|
|
14
|
+
height: 30,
|
|
15
|
+
})),
|
|
16
|
+
}));
|
|
17
|
+
|
|
11
18
|
jest.mock("react-native-safe-area-context", () => ({
|
|
12
19
|
useSafeAreaInsets: jest.fn(() => ({
|
|
13
20
|
top: 20,
|
|
@@ -9,6 +9,7 @@ exports[`PlayerDetails renders properly 1`] = `
|
|
|
9
9
|
"flex": 1,
|
|
10
10
|
"marginTop": -8,
|
|
11
11
|
"paddingTop": -8,
|
|
12
|
+
"width": 750,
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
>
|
|
@@ -29,6 +30,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
|
|
|
29
30
|
"flex": 1,
|
|
30
31
|
"marginTop": -20,
|
|
31
32
|
"paddingTop": 40,
|
|
33
|
+
"width": 750,
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
>
|