@applicaster/zapp-react-native-ui-components 12.0.0-alpha.7528906949 → 12.0.0-alpha.7531504237
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 +26 -5
- package/Components/Layout/TV/ScreenContainer.tsx +79 -5
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +38 -28
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +25 -13
- package/Components/Layout/TV/__tests__/index.test.tsx +2 -1
- package/Components/Layout/TV/index.tsx +11 -65
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -1
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +1 -7
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/index.ts +57 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +20 -0
- 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/Navigator/StackNavigator.tsx +4 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +2 -5
- package/Components/Screen/TV/index.web.tsx +9 -30
- package/Components/Screen/index.tsx +27 -58
- package/Components/Screen/navigationHandler.ts +5 -0
- package/Components/ScreenResolver/index.tsx +6 -11
- package/Components/Transitioner/Scene.tsx +12 -11
- package/Components/Transitioner/Transitioner.tsx +17 -15
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +8 -4
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +52 -24
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +26 -24
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +2 -14
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +31 -7
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +9 -2
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +23 -5
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +28 -8
- package/Components/VideoModal/ModalAnimation/utils.ts +1 -0
- package/Components/VideoModal/PlayerWrapper.tsx +1 -1
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +48 -2
- package/Components/VideoModal/hooks/useModalSize.ts +10 -12
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +4 -4
- package/package.json +5 -5
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
useModalAnimationContext,
|
|
6
6
|
PlayerAnimationStateEnum,
|
|
7
7
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
8
|
-
import { useDimensions } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
9
8
|
|
|
10
9
|
type Props = {
|
|
11
10
|
style: ViewStyle[];
|
|
@@ -18,13 +17,8 @@ export const AnimatedPlayerModalWrapper = (props: Props) => {
|
|
|
18
17
|
animatedValues: { lastScrollY, dragScrollY, translateYOffset },
|
|
19
18
|
modalSnapPoints,
|
|
20
19
|
setStartComponentsAnimation,
|
|
21
|
-
lastScrollYValue,
|
|
22
20
|
} = useModalAnimationContext();
|
|
23
21
|
|
|
24
|
-
const { height: screenHeight } = useDimensions("screen", {
|
|
25
|
-
deviceInfo: true,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
22
|
const interpolateConfig: Animated.InterpolationConfigType = React.useMemo(
|
|
29
23
|
() => ({
|
|
30
24
|
inputRange: modalSnapPoints,
|
|
@@ -51,16 +45,10 @@ export const AnimatedPlayerModalWrapper = (props: Props) => {
|
|
|
51
45
|
}
|
|
52
46
|
|
|
53
47
|
React.useEffect(() => {
|
|
54
|
-
const translateYListener = translateY.addListener((
|
|
55
|
-
const preparedValue = Math.round(
|
|
56
|
-
Math.abs(value) - lastScrollYValue.current
|
|
57
|
-
);
|
|
58
|
-
|
|
48
|
+
const translateYListener = translateY.addListener(() => {
|
|
59
49
|
(playerAnimationState === PlayerAnimationStateEnum.minimize ||
|
|
60
50
|
playerAnimationState === PlayerAnimationStateEnum.maximaze) &&
|
|
61
|
-
setStartComponentsAnimation(
|
|
62
|
-
preparedValue >= Math.round((screenHeight * 10) / 100)
|
|
63
|
-
);
|
|
51
|
+
setStartComponentsAnimation(true);
|
|
64
52
|
});
|
|
65
53
|
|
|
66
54
|
return () => {
|
|
@@ -58,6 +58,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
58
58
|
modalSnapPoints,
|
|
59
59
|
lastSnap,
|
|
60
60
|
setLastSnap,
|
|
61
|
+
setStartComponentsAnimation,
|
|
61
62
|
} = useModalAnimationContext();
|
|
62
63
|
|
|
63
64
|
const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
|
|
@@ -199,12 +200,29 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
199
200
|
videoModalState.mode === "MINIMIZED" &&
|
|
200
201
|
videoModalState.previousMode === "MAXIMIZED"
|
|
201
202
|
) {
|
|
202
|
-
|
|
203
|
+
// set animation to the minimize values if moving from the player to another screen
|
|
204
|
+
if (playerAnimationState === null) {
|
|
205
|
+
setScrollModalAnimatedValue(
|
|
206
|
+
translateYOffset,
|
|
207
|
+
modalSnapPoints[1],
|
|
208
|
+
setLastSnap
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
resetScrollAnimatedValues(
|
|
212
|
+
lastScrollY,
|
|
213
|
+
lastScrollYValue,
|
|
214
|
+
dragScrollY,
|
|
215
|
+
dragVideoPlayerY
|
|
216
|
+
);
|
|
217
|
+
} else {
|
|
218
|
+
resetPlayerAnimationState();
|
|
219
|
+
}
|
|
203
220
|
}
|
|
204
221
|
|
|
205
222
|
if (
|
|
206
223
|
(videoModalState.mode === "MAXIMIZED" &&
|
|
207
|
-
videoModalState.previousMode === "
|
|
224
|
+
videoModalState.previousMode === "MINIMIZED" &&
|
|
225
|
+
previousItemId === videoModalState.item?.id) ||
|
|
208
226
|
previousItemId !== videoModalState.item?.id
|
|
209
227
|
) {
|
|
210
228
|
setPlayerAnimationState(PlayerAnimationStateEnum.maximaze);
|
|
@@ -281,10 +299,11 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
281
299
|
if (
|
|
282
300
|
preparedValue > 0 &&
|
|
283
301
|
scrollPosition.current === 0 &&
|
|
284
|
-
playerAnimationState !== PlayerAnimationStateEnum.drag_player
|
|
302
|
+
playerAnimationState !== PlayerAnimationStateEnum.drag_player &&
|
|
303
|
+
playerAnimationState !== PlayerAnimationStateEnum.drag_scroll
|
|
285
304
|
) {
|
|
286
|
-
|
|
287
|
-
|
|
305
|
+
isMinimizedModal && setStartComponentsAnimation(true);
|
|
306
|
+
setPlayerAnimationState(PlayerAnimationStateEnum.drag_scroll);
|
|
288
307
|
}
|
|
289
308
|
});
|
|
290
309
|
|
|
@@ -292,7 +311,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
292
311
|
lastScrollY.removeListener(lastScrollYListenerId);
|
|
293
312
|
dragScrollY.removeListener(dragListenerId);
|
|
294
313
|
};
|
|
295
|
-
}, [playerAnimationState, isAudioItem, modalSnapPoints]);
|
|
314
|
+
}, [playerAnimationState, isAudioItem, modalSnapPoints, isMinimizedModal]);
|
|
296
315
|
|
|
297
316
|
const Wrapper = React.useMemo(
|
|
298
317
|
() => (Platform.OS === "android" ? GestureHandlerRootView : View),
|
|
@@ -346,7 +365,12 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
|
|
|
346
365
|
};
|
|
347
366
|
|
|
348
367
|
export const AnimatedScrollModal = ({ children }: Props) => {
|
|
349
|
-
const
|
|
368
|
+
const {
|
|
369
|
+
videoModalState: { visible },
|
|
370
|
+
} = useNavigation();
|
|
371
|
+
|
|
372
|
+
const Component =
|
|
373
|
+
!isTV() && visible ? AnimatedScrollModalComponent : React.Fragment;
|
|
350
374
|
|
|
351
375
|
return <Component>{children}</Component>;
|
|
352
376
|
};
|
|
@@ -34,6 +34,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
34
34
|
lastSnap,
|
|
35
35
|
setLastSnap,
|
|
36
36
|
resetPlayerAnimationState,
|
|
37
|
+
setStartComponentsAnimation,
|
|
37
38
|
} = useModalAnimationContext();
|
|
38
39
|
|
|
39
40
|
const { videoModalState } = useNavigation();
|
|
@@ -121,8 +122,10 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
121
122
|
preparedValue > 0 &&
|
|
122
123
|
playerAnimationState !== PlayerAnimationStateEnum.drag_scroll
|
|
123
124
|
) {
|
|
124
|
-
playerAnimationState !== PlayerAnimationStateEnum.drag_player
|
|
125
|
+
if (playerAnimationState !== PlayerAnimationStateEnum.drag_player) {
|
|
126
|
+
isMinimizedModal && setStartComponentsAnimation(true);
|
|
125
127
|
setPlayerAnimationState(PlayerAnimationStateEnum.drag_player);
|
|
128
|
+
}
|
|
126
129
|
|
|
127
130
|
translateYOffset.setValue(
|
|
128
131
|
isMaximazedModal
|
|
@@ -152,7 +155,11 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
|
|
|
152
155
|
};
|
|
153
156
|
|
|
154
157
|
export const AnimatedVideoPlayerComponent = ({ children }: Props) => {
|
|
155
|
-
const
|
|
158
|
+
const {
|
|
159
|
+
videoModalState: { visible },
|
|
160
|
+
} = useNavigation();
|
|
161
|
+
|
|
162
|
+
const Component = !isTV() && visible ? AnimatedVideoPlayer : React.Fragment;
|
|
156
163
|
|
|
157
164
|
return <Component>{children}</Component>;
|
|
158
165
|
};
|
|
@@ -51,6 +51,7 @@ export const AnimationView = ({
|
|
|
51
51
|
setTabletLandscapePlayerTopPosition,
|
|
52
52
|
modalSnapPoints,
|
|
53
53
|
startComponentsAnimationDistance,
|
|
54
|
+
progressBarHeight,
|
|
54
55
|
} = useModalAnimationContext();
|
|
55
56
|
|
|
56
57
|
const isRTL = useIsRTL();
|
|
@@ -62,9 +63,9 @@ export const AnimationView = ({
|
|
|
62
63
|
} = useDimensions("window", { deviceInfo: true });
|
|
63
64
|
|
|
64
65
|
const { videoModalState } = useNavigation();
|
|
65
|
-
const bottomTabBarHeight = useGetBottomTabBarHeight();
|
|
66
|
-
const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
|
|
67
66
|
const insets = useSafeAreaInsets();
|
|
67
|
+
const bottomTabBarHeight = useGetBottomTabBarHeight() + (insets.bottom || 0);
|
|
68
|
+
const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
|
|
68
69
|
const animationComponentRef = useRef(null);
|
|
69
70
|
|
|
70
71
|
// retrieving top position of the player for tablet landscape mode
|
|
@@ -92,12 +93,12 @@ export const AnimationView = ({
|
|
|
92
93
|
const inlineAudioPlayer = additionalData.inlineAudioPlayer;
|
|
93
94
|
|
|
94
95
|
const moveUpValue = additionalData.saveArea
|
|
95
|
-
? -insets.top
|
|
96
|
+
? -insets.top + (isAudioItem ? 0 : progressBarHeight)
|
|
96
97
|
: isTablet
|
|
97
98
|
? isTabletLandscape && (!isAudioItem || (isAudioItem && inlineAudioPlayer))
|
|
98
|
-
? -tabletLandscapePlayerTopPosition
|
|
99
|
+
? -tabletLandscapePlayerTopPosition + progressBarHeight
|
|
99
100
|
: -130
|
|
100
|
-
: -50;
|
|
101
|
+
: -50 + progressBarHeight;
|
|
101
102
|
|
|
102
103
|
const moveComponentHorizontalValue = additionalData.moveValue
|
|
103
104
|
? isRTL
|
|
@@ -308,6 +309,23 @@ export const AnimationView = ({
|
|
|
308
309
|
}
|
|
309
310
|
}, [additionalData, screenWidth]);
|
|
310
311
|
|
|
312
|
+
React.useEffect(() => {
|
|
313
|
+
if (
|
|
314
|
+
videoModalState.mode === "MINIMIZED" &&
|
|
315
|
+
videoModalState.previousMode === "MAXIMIZED"
|
|
316
|
+
) {
|
|
317
|
+
// set animation to the minimize values if moving from the player to another screen
|
|
318
|
+
if (playerAnimationState === null) {
|
|
319
|
+
const value = getAnimationValue(
|
|
320
|
+
animationType,
|
|
321
|
+
PlayerAnimationStateEnum.minimize
|
|
322
|
+
).toValue;
|
|
323
|
+
|
|
324
|
+
animatedValue.setValue(value);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}, [videoModalState]);
|
|
328
|
+
|
|
311
329
|
React.useEffect(() => {
|
|
312
330
|
if (
|
|
313
331
|
playerAnimationState === PlayerAnimationStateEnum.minimize &&
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
2
|
import { Animated } from "react-native";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
useSafeAreaInsets,
|
|
6
|
+
useSafeAreaFrame,
|
|
7
|
+
} from "react-native-safe-area-context";
|
|
5
8
|
import {
|
|
6
9
|
useGetBottomTabBarHeight,
|
|
7
|
-
|
|
10
|
+
useNavigation,
|
|
8
11
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
12
|
+
import { isLive } from "@applicaster/zapp-react-native-utils/playerUtils";
|
|
9
13
|
|
|
14
|
+
import { PROGRESS_BAR_HEIGHT } from "./utils";
|
|
10
15
|
import { useConfiguration } from "../utils";
|
|
11
16
|
|
|
12
17
|
export enum PlayerAnimationStateEnum {
|
|
@@ -40,6 +45,7 @@ export type ModalAnimationContextT = {
|
|
|
40
45
|
tabletLandscapePlayerTopPosition: number;
|
|
41
46
|
setTabletLandscapePlayerTopPosition: (value: number) => void;
|
|
42
47
|
startComponentsAnimationDistance: number;
|
|
48
|
+
progressBarHeight: number;
|
|
43
49
|
};
|
|
44
50
|
|
|
45
51
|
const ReactContext = React.createContext<ModalAnimationContextT>({
|
|
@@ -64,6 +70,7 @@ const ReactContext = React.createContext<ModalAnimationContextT>({
|
|
|
64
70
|
tabletLandscapePlayerTopPosition: 0,
|
|
65
71
|
setTabletLandscapePlayerTopPosition: () => null,
|
|
66
72
|
startComponentsAnimationDistance: 0,
|
|
73
|
+
progressBarHeight: 0,
|
|
67
74
|
});
|
|
68
75
|
|
|
69
76
|
export function useModalAnimationContext() {
|
|
@@ -82,6 +89,11 @@ const Provider = ({ children }: { children: React.ReactNode }) => {
|
|
|
82
89
|
const [startComponentsAnimation, setStartComponentsAnimation] =
|
|
83
90
|
React.useState<boolean>(false);
|
|
84
91
|
|
|
92
|
+
const {
|
|
93
|
+
videoModalState: { mode, visible, item },
|
|
94
|
+
} = useNavigation();
|
|
95
|
+
|
|
96
|
+
const isLiveItem = isLive(item);
|
|
85
97
|
const { minimised_height: minimisedHeight } = useConfiguration();
|
|
86
98
|
|
|
87
99
|
const resetPlayerAnimationState = React.useCallback(() => {
|
|
@@ -95,21 +107,28 @@ const Provider = ({ children }: { children: React.ReactNode }) => {
|
|
|
95
107
|
const translateYOffset = React.useRef(new Animated.Value(0)).current;
|
|
96
108
|
const dragVideoPlayerY = React.useRef(new Animated.Value(0)).current;
|
|
97
109
|
|
|
98
|
-
const { height } =
|
|
110
|
+
const { height: safeAreaFrameHeight } = useSafeAreaFrame();
|
|
111
|
+
const [height, setHeight] = React.useState<number>(safeAreaFrameHeight);
|
|
112
|
+
const progressBarHeight = isLiveItem ? 0 : PROGRESS_BAR_HEIGHT;
|
|
99
113
|
const { bottom: bottomSafeArea } = useSafeAreaInsets();
|
|
100
114
|
const bottomTabBarHeight = useGetBottomTabBarHeight();
|
|
115
|
+
const startComponentsAnimationDistance = Math.round((height * 60) / 100);
|
|
101
116
|
|
|
102
|
-
|
|
103
|
-
(
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
React.useEffect(() => {
|
|
118
|
+
if (visible && mode === "MAXIMIZED" && height !== safeAreaFrameHeight) {
|
|
119
|
+
setHeight(safeAreaFrameHeight);
|
|
120
|
+
}
|
|
121
|
+
}, [height, safeAreaFrameHeight, mode, visible]);
|
|
106
122
|
|
|
107
123
|
/*
|
|
108
124
|
If bottomTabBarHeight is equal 0 it means an app does not use bottomTabBar.
|
|
109
125
|
Because of this we need to minus bottom SafeArea offset.
|
|
110
126
|
*/
|
|
111
127
|
const minValue =
|
|
112
|
-
height -
|
|
128
|
+
height -
|
|
129
|
+
minimisedHeight -
|
|
130
|
+
(bottomTabBarHeight || bottomSafeArea) -
|
|
131
|
+
progressBarHeight;
|
|
113
132
|
|
|
114
133
|
const modalSnapPoints = React.useMemo(() => [0, minValue], [minValue]);
|
|
115
134
|
// Last snap state which will helps us to make smooth responder to scrollview animation
|
|
@@ -142,6 +161,7 @@ const Provider = ({ children }: { children: React.ReactNode }) => {
|
|
|
142
161
|
tabletLandscapePlayerTopPosition,
|
|
143
162
|
setTabletLandscapePlayerTopPosition,
|
|
144
163
|
startComponentsAnimationDistance,
|
|
164
|
+
progressBarHeight,
|
|
145
165
|
}}
|
|
146
166
|
>
|
|
147
167
|
{children}
|
|
@@ -225,7 +225,7 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
225
225
|
</AnimationComponent>
|
|
226
226
|
</View>
|
|
227
227
|
<AnimatedScrollModal>
|
|
228
|
-
{isInlineModal ? (
|
|
228
|
+
{isInlineModal && !docked ? (
|
|
229
229
|
<AnimationComponent
|
|
230
230
|
animationType={ComponentAnimationType.componentFade}
|
|
231
231
|
style={defaultStyles.flex}
|
|
@@ -72,12 +72,34 @@ 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
|
+
isTabletLandscape={false}
|
|
95
|
+
style={
|
|
96
|
+
Object {
|
|
97
|
+
"flex": 1,
|
|
98
|
+
"paddingTop": 20,
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
81
103
|
</View>
|
|
82
104
|
</RNCSafeAreaView>
|
|
83
105
|
</RNCSafeAreaProvider>
|
|
@@ -158,6 +180,7 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
158
180
|
style={
|
|
159
181
|
Object {
|
|
160
182
|
"flex": 1,
|
|
183
|
+
"paddingTop": 20,
|
|
161
184
|
}
|
|
162
185
|
}
|
|
163
186
|
/>
|
|
@@ -254,12 +277,34 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
254
277
|
/>
|
|
255
278
|
</View>
|
|
256
279
|
<View
|
|
280
|
+
animationType="componentFade"
|
|
257
281
|
style={
|
|
258
282
|
Object {
|
|
259
283
|
"flex": 1,
|
|
260
284
|
}
|
|
261
285
|
}
|
|
262
|
-
|
|
286
|
+
>
|
|
287
|
+
<View
|
|
288
|
+
configuration={
|
|
289
|
+
Object {
|
|
290
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
291
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
entry={
|
|
295
|
+
Object {
|
|
296
|
+
"id": "test",
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
isTabletLandscape={true}
|
|
300
|
+
style={
|
|
301
|
+
Object {
|
|
302
|
+
"flex": 1,
|
|
303
|
+
"paddingTop": 20,
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/>
|
|
307
|
+
</View>
|
|
263
308
|
</View>
|
|
264
309
|
</RNCSafeAreaView>
|
|
265
310
|
</RNCSafeAreaProvider>
|
|
@@ -340,6 +385,7 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
340
385
|
style={
|
|
341
386
|
Object {
|
|
342
387
|
"flex": 1,
|
|
388
|
+
"paddingTop": 20,
|
|
343
389
|
}
|
|
344
390
|
}
|
|
345
391
|
/>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Dimensions } from "react-native";
|
|
3
2
|
import { useIsTabletLandscape } from "@applicaster/zapp-react-native-utils/reactHooks/device/useMemoizedIsTablet";
|
|
4
3
|
import {
|
|
5
4
|
addOrientationChangeListener,
|
|
@@ -9,11 +8,10 @@ import {
|
|
|
9
8
|
} from "@applicaster/zapp-react-native-utils/appUtils/orientationHelper";
|
|
10
9
|
|
|
11
10
|
import { getXray } from "@applicaster/zapp-react-native-utils/logger";
|
|
11
|
+
import { useSafeAreaFrame } from "react-native-safe-area-context";
|
|
12
12
|
|
|
13
13
|
const { Logger } = getXray();
|
|
14
14
|
|
|
15
|
-
const { width: WIDTH, height: HEIGHT } = Dimensions.get("window");
|
|
16
|
-
|
|
17
15
|
const logger = new Logger(
|
|
18
16
|
"hooks",
|
|
19
17
|
"zapp-react-native-ui-components/Components/VideoModal"
|
|
@@ -24,20 +22,18 @@ type Size = {
|
|
|
24
22
|
height: number | string;
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
const MODAL_SIZE_FOR_PORTRAIT: Size = {
|
|
28
|
-
width: WIDTH,
|
|
29
|
-
height: HEIGHT,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
25
|
const MODAL_SIZE_FOR_LANDSCAPE: Size = {
|
|
33
26
|
width: "100%",
|
|
34
27
|
height: "100%",
|
|
35
28
|
};
|
|
36
29
|
|
|
37
30
|
export const useModalSize = (): Size => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
const frame = useSafeAreaFrame();
|
|
32
|
+
|
|
33
|
+
const [modalSize, setModalSize] = React.useState<Size>({
|
|
34
|
+
width: frame.width,
|
|
35
|
+
height: frame.height,
|
|
36
|
+
});
|
|
41
37
|
|
|
42
38
|
const setNewModalSize = React.useCallback((newSize, log) => {
|
|
43
39
|
setModalSize((oldSize) => {
|
|
@@ -90,7 +86,9 @@ export const useModalSize = (): Size => {
|
|
|
90
86
|
toOrientation === ORIENTATIONS.landscapeSensor;
|
|
91
87
|
|
|
92
88
|
setNewModalSize(
|
|
93
|
-
isLandscape
|
|
89
|
+
isLandscape
|
|
90
|
+
? MODAL_SIZE_FOR_LANDSCAPE
|
|
91
|
+
: { width: frame.width, height: frame.height },
|
|
94
92
|
`useModalSize: set modal size ${
|
|
95
93
|
isLandscape ? "landscape" : "portrait"
|
|
96
94
|
} for orientation: ${to}`
|
package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap
CHANGED
|
@@ -16,9 +16,9 @@ exports[`DefaultCellRenderer returns a react component and it renders correctly
|
|
|
16
16
|
store={null}
|
|
17
17
|
style={
|
|
18
18
|
Object {
|
|
19
|
-
"backgroundColor": "
|
|
19
|
+
"backgroundColor": "transparent",
|
|
20
20
|
"margin": 12,
|
|
21
|
-
"opacity":
|
|
21
|
+
"opacity": 1,
|
|
22
22
|
"width": 169,
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -105,7 +105,7 @@ exports[`DefaultCellRenderer returns a react component for LG TVs 1`] = `
|
|
|
105
105
|
store={null}
|
|
106
106
|
style={
|
|
107
107
|
Object {
|
|
108
|
-
"backgroundColor": "rgba(
|
|
108
|
+
"backgroundColor": "rgba(47,47,47,1.0)",
|
|
109
109
|
"borderRadius": 4,
|
|
110
110
|
"flex": 1,
|
|
111
111
|
"overflow": "hidden",
|
|
@@ -238,7 +238,7 @@ exports[`DefaultCellRenderer returns a react component for Samsung TVs 1`] = `
|
|
|
238
238
|
store={null}
|
|
239
239
|
style={
|
|
240
240
|
Object {
|
|
241
|
-
"backgroundColor": "rgba(
|
|
241
|
+
"backgroundColor": "rgba(47,47,47,1.0)",
|
|
242
242
|
"borderRadius": 4,
|
|
243
243
|
"flex": 1,
|
|
244
244
|
"overflow": "hidden",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.7531504237",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"redux-mock-store": "^1.5.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.7531504237",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.7531504237",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.7531504237",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.7531504237",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|