@applicaster/zapp-react-native-ui-components 12.0.0-rc.98 → 12.0.1
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 +29 -10
- 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/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 +84 -66
- 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 +72 -10
- 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/const.ts +6 -0
- package/index.js +3 -0
- package/package.json +5 -5
- package/Components/Screen/TV/hooks/useRestoreFocus.ts +0 -22
|
@@ -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,7 +121,35 @@ const getTabletWidth = (
|
|
|
125
121
|
return Number(width) - sidebarWidth;
|
|
126
122
|
};
|
|
127
123
|
|
|
128
|
-
|
|
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
|
+
const PlayerWrapperComponent = (props: Props) => {
|
|
129
153
|
const {
|
|
130
154
|
entry,
|
|
131
155
|
style,
|
|
@@ -143,6 +167,8 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
143
167
|
|
|
144
168
|
const isInlineModal = inline && isModal;
|
|
145
169
|
|
|
170
|
+
// const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
171
|
+
|
|
146
172
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
147
173
|
|
|
148
174
|
const tabletWidth = getTabletWidth(configuration, style);
|
|
@@ -181,71 +207,63 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
181
207
|
[containerDimensions, playerDimesionsHack]
|
|
182
208
|
);
|
|
183
209
|
|
|
184
|
-
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${entry?.id}`;
|
|
185
|
-
|
|
186
210
|
return (
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
211
|
+
<WrapperView
|
|
212
|
+
edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
|
|
213
|
+
style={[
|
|
214
|
+
safeAreaStyles(configuration, isTablet),
|
|
215
|
+
style,
|
|
216
|
+
playerDimesionsHack,
|
|
217
|
+
]}
|
|
218
|
+
>
|
|
219
|
+
<AnimationComponent
|
|
220
|
+
animationType={ComponentAnimationType.moveUpComponent}
|
|
221
|
+
additionalData={{ saveArea: true }}
|
|
222
|
+
style={[directionStyles(isTabletLandscape), defaultStyles.flex]}
|
|
223
|
+
>
|
|
224
|
+
<View
|
|
225
|
+
testID={`${entry?.id}-player-container`}
|
|
191
226
|
style={[
|
|
192
|
-
|
|
193
|
-
|
|
227
|
+
defaultStyles.playerContainer,
|
|
228
|
+
containerDimensions,
|
|
229
|
+
containerStyle,
|
|
194
230
|
playerDimesionsHack,
|
|
195
231
|
]}
|
|
196
232
|
>
|
|
197
233
|
<AnimationComponent
|
|
198
234
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
199
|
-
|
|
200
|
-
|
|
235
|
+
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
236
|
+
additionalData={{
|
|
237
|
+
useLayoutMeasure: isTabletLandscape,
|
|
238
|
+
disableAnimatedComponent: !isTabletLandscape,
|
|
239
|
+
resetAnimationValue: isTabletLandscape && docked,
|
|
240
|
+
}}
|
|
201
241
|
>
|
|
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>
|
|
242
|
+
<AnimatedVideoPlayerComponent>
|
|
243
|
+
{children(childrenStyles)}
|
|
244
|
+
</AnimatedVideoPlayerComponent>
|
|
246
245
|
</AnimationComponent>
|
|
247
|
-
</
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
</View>
|
|
247
|
+
|
|
248
|
+
<AnimatedScrollModal>
|
|
249
|
+
{showDetails(!isTablet, docked, isInlineModal, pip) && (
|
|
250
|
+
<AnimationComponent
|
|
251
|
+
animationType={ComponentAnimationType.componentFade}
|
|
252
|
+
style={defaultStyles.flex}
|
|
253
|
+
>
|
|
254
|
+
<PlayerDetails
|
|
255
|
+
configuration={configuration}
|
|
256
|
+
style={defaultStyles.playerDetails}
|
|
257
|
+
entry={entry}
|
|
258
|
+
isTabletLandscape={isTabletLandscape}
|
|
259
|
+
isTablet={isTablet}
|
|
260
|
+
/>
|
|
261
|
+
</AnimationComponent>
|
|
262
|
+
)}
|
|
263
|
+
</AnimatedScrollModal>
|
|
264
|
+
</AnimationComponent>
|
|
265
|
+
</WrapperView>
|
|
250
266
|
);
|
|
251
267
|
};
|
|
268
|
+
|
|
269
|
+
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
|
>
|
|
@@ -72,12 +72,35 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
72
72
|
testID="test-player-container"
|
|
73
73
|
/>
|
|
74
74
|
<View
|
|
75
|
+
animationType="componentFade"
|
|
75
76
|
style={
|
|
76
77
|
Object {
|
|
77
78
|
"flex": 1,
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
>
|
|
82
|
+
<View
|
|
83
|
+
configuration={
|
|
84
|
+
Object {
|
|
85
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
86
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
entry={
|
|
90
|
+
Object {
|
|
91
|
+
"id": "test",
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
isTablet={false}
|
|
95
|
+
isTabletLandscape={false}
|
|
96
|
+
style={
|
|
97
|
+
Object {
|
|
98
|
+
"flex": 1,
|
|
99
|
+
"paddingTop": 20,
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/>
|
|
103
|
+
</View>
|
|
81
104
|
</View>
|
|
82
105
|
</RNCSafeAreaView>
|
|
83
106
|
</RNCSafeAreaProvider>
|
|
@@ -155,12 +178,35 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
155
178
|
testID="test-player-container"
|
|
156
179
|
/>
|
|
157
180
|
<View
|
|
181
|
+
animationType="componentFade"
|
|
158
182
|
style={
|
|
159
183
|
Object {
|
|
160
184
|
"flex": 1,
|
|
161
185
|
}
|
|
162
186
|
}
|
|
163
|
-
|
|
187
|
+
>
|
|
188
|
+
<View
|
|
189
|
+
configuration={
|
|
190
|
+
Object {
|
|
191
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
192
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
entry={
|
|
196
|
+
Object {
|
|
197
|
+
"id": "test",
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
isTablet={false}
|
|
201
|
+
isTabletLandscape={false}
|
|
202
|
+
style={
|
|
203
|
+
Object {
|
|
204
|
+
"flex": 1,
|
|
205
|
+
"paddingTop": 20,
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
</View>
|
|
164
210
|
</View>
|
|
165
211
|
</RNCSafeAreaView>
|
|
166
212
|
</RNCSafeAreaProvider>
|
|
@@ -254,12 +300,35 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
254
300
|
/>
|
|
255
301
|
</View>
|
|
256
302
|
<View
|
|
303
|
+
animationType="componentFade"
|
|
257
304
|
style={
|
|
258
305
|
Object {
|
|
259
306
|
"flex": 1,
|
|
260
307
|
}
|
|
261
308
|
}
|
|
262
|
-
|
|
309
|
+
>
|
|
310
|
+
<View
|
|
311
|
+
configuration={
|
|
312
|
+
Object {
|
|
313
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
314
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
entry={
|
|
318
|
+
Object {
|
|
319
|
+
"id": "test",
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
isTablet={true}
|
|
323
|
+
isTabletLandscape={true}
|
|
324
|
+
style={
|
|
325
|
+
Object {
|
|
326
|
+
"flex": 1,
|
|
327
|
+
"paddingTop": 20,
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
/>
|
|
331
|
+
</View>
|
|
263
332
|
</View>
|
|
264
333
|
</RNCSafeAreaView>
|
|
265
334
|
</RNCSafeAreaProvider>
|
|
@@ -336,13 +405,6 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
336
405
|
}
|
|
337
406
|
testID="test-player-container"
|
|
338
407
|
/>
|
|
339
|
-
<View
|
|
340
|
-
style={
|
|
341
|
-
Object {
|
|
342
|
-
"flex": 1,
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
/>
|
|
346
408
|
</View>
|
|
347
409
|
</RNCSafeAreaView>
|
|
348
410
|
</RNCSafeAreaProvider>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
3
4
|
|
|
4
5
|
import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
|
|
5
6
|
import CloseButton from "./Buttons/CloseButton";
|
|
@@ -44,11 +45,14 @@ const BarView = ({ screenStyles, barState = defaultState }: Props) => {
|
|
|
44
45
|
);
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
|
-
<
|
|
48
|
+
<SafeAreaView
|
|
49
|
+
style={[style.view, isRTL ? style.rtlStyle : {}]}
|
|
50
|
+
testID="BarView-safeAreaView"
|
|
51
|
+
>
|
|
48
52
|
{backButton}
|
|
49
53
|
<BarTitle title={barState.title} screenStyles={screenStyles} />
|
|
50
54
|
{closeButton}
|
|
51
|
-
</
|
|
55
|
+
</SafeAreaView>
|
|
52
56
|
);
|
|
53
57
|
};
|
|
54
58
|
|
|
@@ -11,12 +11,16 @@ const renderEmptyView = () => {
|
|
|
11
11
|
return <View style={emptyViewStyle} />;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
type FloatingButtonProps = {
|
|
14
|
+
type FloatingButtonProps = Testable & {
|
|
15
15
|
onPress: () => void;
|
|
16
16
|
screenStyles: any;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const BackButton = ({
|
|
19
|
+
const BackButton = ({
|
|
20
|
+
onPress,
|
|
21
|
+
screenStyles,
|
|
22
|
+
testID = "backButton",
|
|
23
|
+
}: FloatingButtonProps) => {
|
|
20
24
|
const containerStyle: any = {};
|
|
21
25
|
|
|
22
26
|
if (!onPress) {
|
|
@@ -25,6 +29,7 @@ const BackButton = ({ onPress, screenStyles }: FloatingButtonProps) => {
|
|
|
25
29
|
|
|
26
30
|
return (
|
|
27
31
|
<ActionButton
|
|
32
|
+
testID={`${testID}-actionButton`}
|
|
28
33
|
onPress={onPress}
|
|
29
34
|
buttonStyles={containerStyle}
|
|
30
35
|
imageUrl={screenStyles.back_button_image}
|
|
@@ -11,12 +11,16 @@ const renderEmptyView = () => {
|
|
|
11
11
|
return <View style={emptyViewStyle} />;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
type CloseButtonProps = {
|
|
14
|
+
type CloseButtonProps = Testable & {
|
|
15
15
|
onPress: () => void;
|
|
16
16
|
screenStyles?: any;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const CloseButton = ({
|
|
19
|
+
const CloseButton = ({
|
|
20
|
+
onPress,
|
|
21
|
+
screenStyles,
|
|
22
|
+
testID = "closeButton",
|
|
23
|
+
}: CloseButtonProps) => {
|
|
20
24
|
const containerStyle: any = {};
|
|
21
25
|
|
|
22
26
|
if (!onPress) {
|
|
@@ -25,6 +29,7 @@ const CloseButton = ({ onPress, screenStyles }: CloseButtonProps) => {
|
|
|
25
29
|
|
|
26
30
|
return (
|
|
27
31
|
<ActionButton
|
|
32
|
+
testID={`${testID}-actionButton`}
|
|
28
33
|
onPress={onPress}
|
|
29
34
|
buttonStyles={containerStyle}
|
|
30
35
|
imageUrl={screenStyles.close_button_image}
|