@applicaster/zapp-react-native-ui-components 12.0.0-rc.5 → 12.0.0-rc.51
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/AnimatedInOut/index.tsx +18 -10
- package/Components/AudioPlayer/AudioPlayer.tsx +9 -1
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +5 -0
- package/Components/AudioPlayer/helpers.tsx +1 -0
- package/Components/Cell/Cell.tsx +2 -2
- package/Components/Cell/CellWithFocusable.tsx +21 -14
- package/Components/Cell/TvOSCellComponent.tsx +2 -2
- package/Components/ErrorScreen/index.tsx +1 -1
- package/Components/FocusableCell/index.tsx +7 -7
- package/Components/FocusableList/FocusableChild.ts +24 -14
- package/Components/FocusableList/FocusableItem.tsx +1 -1
- package/Components/FocusableList/FocusableListItemWrapper.tsx +76 -0
- package/Components/FocusableList/hooks/useCellState.android.ts +3 -1
- package/Components/FocusableList/index.tsx +26 -25
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +11 -8
- package/Components/HandlePlayable/HandlePlayable.tsx +1 -1
- package/Components/HookRenderer/index.tsx +1 -6
- package/Components/Image/Image.android.tsx +3 -22
- package/Components/Image/Image.tsx +18 -2
- package/Components/Image/utils/index.ts +39 -0
- package/Components/Layout/TV/__tests__/index.test.tsx +1 -34
- package/Components/Layout/TV/index.tsx +20 -36
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +0 -1
- package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +21 -8
- package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +9 -26
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImageSize.ts +65 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +17 -2
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +3 -2
- package/Components/MasterCell/DefaultComponents/Toggle.tsx +5 -1
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/index.ts +8 -10
- package/Components/MasterCell/utils/index.ts +16 -5
- package/Components/ModalComponent/BottomSheetModalContent.tsx +121 -0
- package/Components/ModalComponent/Button/Item.tsx +82 -0
- package/Components/ModalComponent/Button/ItemIcon.tsx +60 -0
- package/Components/ModalComponent/Button/ItemLabel.tsx +101 -0
- package/Components/ModalComponent/Button/assets.ts +4 -0
- package/Components/ModalComponent/Button/index.tsx +111 -0
- package/Components/ModalComponent/Header/CloseButton.tsx +59 -0
- package/Components/ModalComponent/Header/Title.tsx +70 -0
- package/Components/ModalComponent/Header/assets.ts +4 -0
- package/Components/ModalComponent/Header/index.tsx +71 -0
- package/Components/ModalComponent/Header/utils.ts +79 -0
- package/Components/ModalComponent/index.tsx +38 -0
- package/Components/ModalComponent/utils.ts +126 -0
- package/Components/PlayerContainer/ErrorDisplay/ErrorDisplay.tsx +4 -7
- package/Components/PlayerContainer/PlayerContainer.tsx +60 -30
- package/Components/PlayerContainer/ProgramInfo/index.tsx +3 -1
- package/Components/PlayerImageBackground/index.tsx +34 -8
- package/Components/River/ComponentsMap/ComponentsMap.tsx +25 -0
- package/Components/River/River.tsx +8 -5
- package/Components/River/TV/River.tsx +2 -2
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +1 -1
- package/Components/River/__tests__/componentsMap.test.js +7 -0
- package/Components/River/useScreenConfiguration.ts +5 -6
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +1 -0
- package/Components/RouteManager/__tests__/routeManager.test.js +9 -2
- package/Components/RouteManager/index.tsx +5 -3
- package/Components/Screen/__tests__/Screen.test.tsx +48 -36
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +20 -6
- package/Components/Screen/__tests__/navigationHandler.test.ts +1 -178
- package/Components/Screen/index.tsx +92 -44
- package/Components/Screen/navigationHandler.ts +0 -82
- package/Components/Screen/orientationHandler.ts +1 -1
- package/Components/ScreenResolver/index.tsx +1 -1
- package/Components/Tabs/TV/styles.ts +1 -1
- package/Components/TrackedView/index.tsx +6 -3
- package/Components/VideoLive/LiveImageManager.ts +42 -13
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +81 -72
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +45 -3
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +22 -27
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +78 -0
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +342 -0
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +151 -0
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +438 -0
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +143 -0
- package/Components/VideoModal/ModalAnimation/index.ts +15 -0
- package/Components/VideoModal/ModalAnimation/utils.ts +299 -0
- package/Components/VideoModal/PlayerDetails.tsx +3 -0
- package/Components/VideoModal/PlayerWrapper.tsx +119 -95
- package/Components/VideoModal/VideoModal.tsx +8 -25
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +0 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +8 -3
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +242 -166
- package/Components/VideoModal/hooks/useModalSize.ts +13 -4
- package/Components/VideoModal/utils.ts +3 -3
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +26 -21
- package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +4 -5
- package/Components/ZappUIComponent/index.tsx +22 -12
- package/Components/index.js +2 -0
- package/Contexts/ScreenContext/index.tsx +1 -4
- package/Decorators/ComponentsMapWrapper/withComponentsMapProvider.tsx +7 -2
- package/Decorators/RiverResolver/index.tsx +0 -4
- package/Decorators/index.tsx +0 -4
- package/package.json +5 -6
- package/Components/VideoModal/hooks/usePosition.ts +0 -50
|
@@ -4,9 +4,7 @@ import { StyleSheet, View } from "react-native";
|
|
|
4
4
|
|
|
5
5
|
import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
|
|
6
6
|
import {
|
|
7
|
-
MenuTypes,
|
|
8
7
|
useNavigation,
|
|
9
|
-
useNavigationType,
|
|
10
8
|
useZappHooksForEntry,
|
|
11
9
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
12
10
|
import { useIsInitialRender } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
|
|
@@ -16,12 +14,12 @@ import {
|
|
|
16
14
|
allowedOrientationsForScreen,
|
|
17
15
|
ORIENTATIONS,
|
|
18
16
|
} from "@applicaster/zapp-react-native-utils/appUtils/orientationHelper";
|
|
17
|
+
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks/device/useIsTablet";
|
|
19
18
|
|
|
20
19
|
import { withModalNavigationContextProvider } from "../../Contexts/ModalNavigationContext";
|
|
21
20
|
import { useModalSize } from "./hooks/useModalSize";
|
|
22
21
|
import { useBackgroundColor } from "./hooks/useBackgroundColor";
|
|
23
22
|
import { useInitialPlayerState } from "./hooks/useInitialPlayerState";
|
|
24
|
-
import { usePosition } from "./hooks/usePosition";
|
|
25
23
|
import { APP_EVENTS } from "@applicaster/zapp-react-native-utils/appUtils/events";
|
|
26
24
|
import { Spinner } from "../Spinner";
|
|
27
25
|
import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
|
|
@@ -31,6 +29,8 @@ import { requiresAuthentication } from "@applicaster/zapp-react-native-utils/con
|
|
|
31
29
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
32
30
|
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
33
31
|
|
|
32
|
+
import { AnimatedPlayerModalWrapper } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
33
|
+
|
|
34
34
|
const styles = StyleSheet.create({
|
|
35
35
|
container: {
|
|
36
36
|
top: 0,
|
|
@@ -59,22 +59,9 @@ const VideoModalComponent = () => {
|
|
|
59
59
|
const onVideoModalHookSuccessAnalyticsEvent = useVideoModalAnalytics();
|
|
60
60
|
|
|
61
61
|
const modalSize = useModalSize();
|
|
62
|
-
|
|
63
62
|
const isFirstRender = useIsInitialRender();
|
|
64
|
-
|
|
65
63
|
const backgroundColor = useBackgroundColor();
|
|
66
64
|
|
|
67
|
-
const { top, height, bottom } = usePosition();
|
|
68
|
-
|
|
69
|
-
const navType = useNavigationType();
|
|
70
|
-
const isBottomBarsNavigation = navType === MenuTypes.bottomTabBar;
|
|
71
|
-
const heightWithSafeArea = height ? height + bottom : null;
|
|
72
|
-
|
|
73
|
-
const dockedHeight =
|
|
74
|
-
isBottomBarsNavigation && height ? height : heightWithSafeArea;
|
|
75
|
-
|
|
76
|
-
const dockedBottom = isBottomBarsNavigation ? bottom : 0;
|
|
77
|
-
|
|
78
65
|
const {
|
|
79
66
|
closeVideoModal,
|
|
80
67
|
setVideoModalItem,
|
|
@@ -83,8 +70,6 @@ const VideoModalComponent = () => {
|
|
|
83
70
|
maximiseVideoModal,
|
|
84
71
|
} = useNavigation();
|
|
85
72
|
|
|
86
|
-
const docked = mode === "MINIMIZED";
|
|
87
|
-
|
|
88
73
|
const logTimestamp = useProfilerLogging();
|
|
89
74
|
|
|
90
75
|
useInitialPlayerState(fullscreenVideoModal, maximiseVideoModal, item);
|
|
@@ -105,9 +90,10 @@ const VideoModalComponent = () => {
|
|
|
105
90
|
}, [item?.id]);
|
|
106
91
|
|
|
107
92
|
const isLandscape = modalSize.width > modalSize.height;
|
|
93
|
+
const isTablet = useIsTablet();
|
|
108
94
|
|
|
109
95
|
React.useEffect(() => {
|
|
110
|
-
if (isLandscape && mode !== "FULLSCREEN" && mode !== "PIP") {
|
|
96
|
+
if (!isTablet && isLandscape && mode !== "FULLSCREEN" && mode !== "PIP") {
|
|
111
97
|
fullscreenVideoModal();
|
|
112
98
|
}
|
|
113
99
|
}, [isLandscape]);
|
|
@@ -143,13 +129,10 @@ const VideoModalComponent = () => {
|
|
|
143
129
|
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${item?.id}`;
|
|
144
130
|
|
|
145
131
|
return (
|
|
146
|
-
<
|
|
132
|
+
<AnimatedPlayerModalWrapper
|
|
147
133
|
style={[
|
|
148
134
|
styles.container,
|
|
149
135
|
{
|
|
150
|
-
top,
|
|
151
|
-
height: dockedHeight,
|
|
152
|
-
bottom: dockedBottom,
|
|
153
136
|
backgroundColor,
|
|
154
137
|
},
|
|
155
138
|
]}
|
|
@@ -160,7 +143,7 @@ const VideoModalComponent = () => {
|
|
|
160
143
|
<HandlePlayable
|
|
161
144
|
item={item}
|
|
162
145
|
isModal={mode !== "PIP"}
|
|
163
|
-
modalHeight={
|
|
146
|
+
modalHeight={modalSize.height}
|
|
164
147
|
modalWidth={modalSize.width}
|
|
165
148
|
mode={mode}
|
|
166
149
|
/>
|
|
@@ -171,7 +154,7 @@ const VideoModalComponent = () => {
|
|
|
171
154
|
)}
|
|
172
155
|
</PathnameContext.Provider>
|
|
173
156
|
</ScreenContextProvider>
|
|
174
|
-
</
|
|
157
|
+
</AnimatedPlayerModalWrapper>
|
|
175
158
|
);
|
|
176
159
|
};
|
|
177
160
|
|
|
@@ -21,6 +21,8 @@ const useIsTablet = jest.fn();
|
|
|
21
21
|
|
|
22
22
|
jest.mock("react-native");
|
|
23
23
|
|
|
24
|
+
jest.mock("react-native-gesture-handler");
|
|
25
|
+
|
|
24
26
|
jest.mock("../PlayerDetails", () => ({ PlayerDetails: View }));
|
|
25
27
|
|
|
26
28
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/device", () => ({
|
|
@@ -38,6 +40,7 @@ jest.mock("@applicaster/zapp-react-native-utils/reactUtils", () => ({
|
|
|
38
40
|
}));
|
|
39
41
|
|
|
40
42
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
43
|
+
isNavBarVisible: jest.fn(() => true),
|
|
41
44
|
useRoute: jest.fn(() => ({
|
|
42
45
|
pathname: "/river/testId",
|
|
43
46
|
})),
|
|
@@ -45,12 +48,13 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
|
45
48
|
canGoBack: () => false,
|
|
46
49
|
currentRoute: "/river/testId",
|
|
47
50
|
data: { screen: { id: "testId" } },
|
|
51
|
+
videoModalState: { visible: false },
|
|
48
52
|
})),
|
|
49
53
|
}));
|
|
50
54
|
|
|
51
55
|
jest.mock("../utils", () => ({ playerDimesionsHack: {} }));
|
|
52
56
|
|
|
53
|
-
const { PlayerWrapper
|
|
57
|
+
const { PlayerWrapper } = require("../PlayerWrapper");
|
|
54
58
|
|
|
55
59
|
jest.useFakeTimers();
|
|
56
60
|
const children = jest.fn(() => {});
|
|
@@ -94,7 +98,7 @@ describe("PlayerWrapper", () => {
|
|
|
94
98
|
useIsTablet.mockReturnValue(false);
|
|
95
99
|
|
|
96
100
|
const children = jest.fn(() => {});
|
|
97
|
-
const dimensions = { height:
|
|
101
|
+
const dimensions = { height: undefined, width: props.style.width };
|
|
98
102
|
|
|
99
103
|
const element = renderWithProviders(
|
|
100
104
|
<PlayerWrapper
|
|
@@ -110,7 +114,8 @@ describe("PlayerWrapper", () => {
|
|
|
110
114
|
|
|
111
115
|
const expectDimensions = {
|
|
112
116
|
...dimensions,
|
|
113
|
-
width:
|
|
117
|
+
width: undefined,
|
|
118
|
+
aspectRatio: 16 / 9,
|
|
114
119
|
};
|
|
115
120
|
|
|
116
121
|
expect(element).toMatchSnapshot();
|
|
@@ -1,253 +1,329 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`PlayerWrapper renders inline 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
Object {
|
|
7
|
-
"bottom": "off",
|
|
8
|
-
"left": "off",
|
|
9
|
-
"right": "off",
|
|
10
|
-
"top": "additive",
|
|
11
|
-
}
|
|
12
|
-
}
|
|
4
|
+
<RNCSafeAreaProvider
|
|
5
|
+
onInsetsChange={[Function]}
|
|
13
6
|
style={
|
|
14
7
|
Array [
|
|
15
8
|
Object {
|
|
16
|
-
"
|
|
17
|
-
},
|
|
18
|
-
Object {
|
|
19
|
-
"backgroundColor": "transparent",
|
|
20
|
-
},
|
|
21
|
-
Object {
|
|
22
|
-
"height": 800,
|
|
23
|
-
"width": 300,
|
|
9
|
+
"flex": 1,
|
|
24
10
|
},
|
|
25
|
-
|
|
11
|
+
undefined,
|
|
26
12
|
]
|
|
27
13
|
}
|
|
28
14
|
>
|
|
29
|
-
<
|
|
15
|
+
<RNCSafeAreaView
|
|
16
|
+
edges={
|
|
17
|
+
Object {
|
|
18
|
+
"bottom": "off",
|
|
19
|
+
"left": "off",
|
|
20
|
+
"right": "off",
|
|
21
|
+
"top": "additive",
|
|
22
|
+
}
|
|
23
|
+
}
|
|
30
24
|
style={
|
|
31
25
|
Array [
|
|
32
26
|
Object {
|
|
33
|
-
"
|
|
34
|
-
"position": "relative",
|
|
35
|
-
"zIndex": 200,
|
|
27
|
+
"backgroundColor": "transparent",
|
|
36
28
|
},
|
|
37
29
|
Object {
|
|
38
|
-
"height":
|
|
30
|
+
"height": 800,
|
|
39
31
|
"width": 300,
|
|
40
32
|
},
|
|
41
33
|
Object {},
|
|
42
|
-
Object {
|
|
43
|
-
"aspectRatio": 1.7777777777777777,
|
|
44
|
-
"height": undefined,
|
|
45
|
-
"width": "100%",
|
|
46
|
-
},
|
|
47
|
-
Object {},
|
|
48
34
|
]
|
|
49
35
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"tablet_landscape_sidebar_width": "35%",
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
entry={
|
|
60
|
-
Object {
|
|
61
|
-
"id": "test",
|
|
36
|
+
>
|
|
37
|
+
<View
|
|
38
|
+
additionalData={
|
|
39
|
+
Object {
|
|
40
|
+
"saveArea": true,
|
|
41
|
+
}
|
|
62
42
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"paddingTop": 20,
|
|
43
|
+
animationType="moveUpComponent"
|
|
44
|
+
style={
|
|
45
|
+
Object {
|
|
46
|
+
"flexDirection": "column",
|
|
47
|
+
}
|
|
69
48
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
>
|
|
50
|
+
<View
|
|
51
|
+
style={
|
|
52
|
+
Array [
|
|
53
|
+
Object {
|
|
54
|
+
"alignSelf": "center",
|
|
55
|
+
"position": "relative",
|
|
56
|
+
"zIndex": 200,
|
|
57
|
+
},
|
|
58
|
+
Object {
|
|
59
|
+
"aspectRatio": 1.7777777777777777,
|
|
60
|
+
"height": undefined,
|
|
61
|
+
"width": "100%",
|
|
62
|
+
},
|
|
63
|
+
Object {},
|
|
64
|
+
Object {},
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
testID="test-player-container"
|
|
68
|
+
/>
|
|
69
|
+
<View
|
|
70
|
+
style={
|
|
71
|
+
Object {
|
|
72
|
+
"flex": 1,
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/>
|
|
76
|
+
</View>
|
|
77
|
+
</RNCSafeAreaView>
|
|
78
|
+
</RNCSafeAreaProvider>
|
|
73
79
|
`;
|
|
74
80
|
|
|
75
81
|
exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
Object {
|
|
79
|
-
"bottom": "additive",
|
|
80
|
-
"left": "off",
|
|
81
|
-
"right": "off",
|
|
82
|
-
"top": "off",
|
|
83
|
-
}
|
|
84
|
-
}
|
|
82
|
+
<RNCSafeAreaProvider
|
|
83
|
+
onInsetsChange={[Function]}
|
|
85
84
|
style={
|
|
86
85
|
Array [
|
|
87
86
|
Object {
|
|
88
|
-
"
|
|
89
|
-
},
|
|
90
|
-
Object {
|
|
91
|
-
"backgroundColor": "transparent",
|
|
92
|
-
},
|
|
93
|
-
Object {
|
|
94
|
-
"height": 50,
|
|
95
|
-
"width": 300,
|
|
87
|
+
"flex": 1,
|
|
96
88
|
},
|
|
97
|
-
|
|
89
|
+
undefined,
|
|
98
90
|
]
|
|
99
91
|
}
|
|
100
92
|
>
|
|
101
|
-
<
|
|
93
|
+
<RNCSafeAreaView
|
|
94
|
+
edges={
|
|
95
|
+
Object {
|
|
96
|
+
"bottom": "off",
|
|
97
|
+
"left": "off",
|
|
98
|
+
"right": "off",
|
|
99
|
+
"top": "additive",
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
102
|
style={
|
|
103
103
|
Array [
|
|
104
104
|
Object {
|
|
105
|
-
"
|
|
106
|
-
"position": "relative",
|
|
107
|
-
"zIndex": 200,
|
|
105
|
+
"backgroundColor": "transparent",
|
|
108
106
|
},
|
|
109
107
|
Object {
|
|
110
|
-
"height":
|
|
108
|
+
"height": undefined,
|
|
111
109
|
"width": 300,
|
|
112
110
|
},
|
|
113
111
|
Object {},
|
|
114
|
-
Object {},
|
|
115
|
-
Object {},
|
|
116
112
|
]
|
|
117
113
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"paddingTop": 20,
|
|
114
|
+
>
|
|
115
|
+
<View
|
|
116
|
+
additionalData={
|
|
117
|
+
Object {
|
|
118
|
+
"saveArea": true,
|
|
119
|
+
}
|
|
125
120
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
animationType="moveUpComponent"
|
|
122
|
+
style={
|
|
123
|
+
Object {
|
|
124
|
+
"flexDirection": "column",
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
>
|
|
128
|
+
<View
|
|
129
|
+
style={
|
|
130
|
+
Array [
|
|
131
|
+
Object {
|
|
132
|
+
"alignSelf": "center",
|
|
133
|
+
"position": "relative",
|
|
134
|
+
"zIndex": 200,
|
|
135
|
+
},
|
|
136
|
+
Object {
|
|
137
|
+
"aspectRatio": undefined,
|
|
138
|
+
"height": undefined,
|
|
139
|
+
"width": "100%",
|
|
140
|
+
},
|
|
141
|
+
Object {},
|
|
142
|
+
Object {},
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
testID="test-player-container"
|
|
146
|
+
/>
|
|
147
|
+
<View
|
|
148
|
+
style={
|
|
149
|
+
Object {
|
|
150
|
+
"flex": 1,
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/>
|
|
154
|
+
</View>
|
|
155
|
+
</RNCSafeAreaView>
|
|
156
|
+
</RNCSafeAreaProvider>
|
|
129
157
|
`;
|
|
130
158
|
|
|
131
159
|
exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
Object {
|
|
135
|
-
"bottom": "off",
|
|
136
|
-
"left": "off",
|
|
137
|
-
"right": "off",
|
|
138
|
-
"top": "additive",
|
|
139
|
-
}
|
|
140
|
-
}
|
|
160
|
+
<RNCSafeAreaProvider
|
|
161
|
+
onInsetsChange={[Function]}
|
|
141
162
|
style={
|
|
142
163
|
Array [
|
|
143
164
|
Object {
|
|
144
|
-
"
|
|
145
|
-
},
|
|
146
|
-
Object {
|
|
147
|
-
"backgroundColor": "red",
|
|
148
|
-
},
|
|
149
|
-
Object {
|
|
150
|
-
"height": 800,
|
|
151
|
-
"width": 300,
|
|
165
|
+
"flex": 1,
|
|
152
166
|
},
|
|
153
|
-
|
|
167
|
+
undefined,
|
|
154
168
|
]
|
|
155
169
|
}
|
|
156
170
|
>
|
|
157
|
-
<
|
|
171
|
+
<RNCSafeAreaView
|
|
172
|
+
edges={
|
|
173
|
+
Object {
|
|
174
|
+
"bottom": "off",
|
|
175
|
+
"left": "off",
|
|
176
|
+
"right": "off",
|
|
177
|
+
"top": "additive",
|
|
178
|
+
}
|
|
179
|
+
}
|
|
158
180
|
style={
|
|
159
181
|
Array [
|
|
160
182
|
Object {
|
|
161
|
-
"
|
|
162
|
-
"position": "relative",
|
|
163
|
-
"zIndex": 200,
|
|
183
|
+
"backgroundColor": "red",
|
|
164
184
|
},
|
|
165
185
|
Object {
|
|
166
|
-
"height":
|
|
167
|
-
"width":
|
|
186
|
+
"height": 800,
|
|
187
|
+
"width": 300,
|
|
168
188
|
},
|
|
169
189
|
Object {},
|
|
170
|
-
Object {},
|
|
171
|
-
Object {},
|
|
172
190
|
]
|
|
173
191
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
"tablet_landscape_sidebar_width": "35%",
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
entry={
|
|
184
|
-
Object {
|
|
185
|
-
"id": "test",
|
|
192
|
+
>
|
|
193
|
+
<View
|
|
194
|
+
additionalData={
|
|
195
|
+
Object {
|
|
196
|
+
"saveArea": true,
|
|
197
|
+
}
|
|
186
198
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"paddingTop": 20,
|
|
199
|
+
animationType="moveUpComponent"
|
|
200
|
+
style={
|
|
201
|
+
Object {
|
|
202
|
+
"flexDirection": "row",
|
|
203
|
+
}
|
|
193
204
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
205
|
+
>
|
|
206
|
+
<View
|
|
207
|
+
style={
|
|
208
|
+
Array [
|
|
209
|
+
Object {
|
|
210
|
+
"alignSelf": "center",
|
|
211
|
+
"position": "relative",
|
|
212
|
+
"zIndex": 200,
|
|
213
|
+
},
|
|
214
|
+
Object {
|
|
215
|
+
"aspectRatio": 1.7777777777777777,
|
|
216
|
+
"height": undefined,
|
|
217
|
+
"width": 195,
|
|
218
|
+
},
|
|
219
|
+
Object {},
|
|
220
|
+
Object {},
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
testID="test-player-container"
|
|
224
|
+
>
|
|
225
|
+
<View
|
|
226
|
+
additionalData={
|
|
227
|
+
Object {
|
|
228
|
+
"disableAnimatedComponent": false,
|
|
229
|
+
"resetAnimationValue": undefined,
|
|
230
|
+
"useLayoutMeasure": true,
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
animationType="moveUpComponent"
|
|
234
|
+
style={
|
|
235
|
+
Object {
|
|
236
|
+
"flex": 1,
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/>
|
|
240
|
+
</View>
|
|
241
|
+
<View
|
|
242
|
+
style={
|
|
243
|
+
Object {
|
|
244
|
+
"flex": 1,
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/>
|
|
248
|
+
</View>
|
|
249
|
+
</RNCSafeAreaView>
|
|
250
|
+
</RNCSafeAreaProvider>
|
|
197
251
|
`;
|
|
198
252
|
|
|
199
253
|
exports[`PlayerWrapper renders properly 1`] = `
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
Object {
|
|
203
|
-
"bottom": "off",
|
|
204
|
-
"left": "off",
|
|
205
|
-
"right": "off",
|
|
206
|
-
"top": "additive",
|
|
207
|
-
}
|
|
208
|
-
}
|
|
254
|
+
<RNCSafeAreaProvider
|
|
255
|
+
onInsetsChange={[Function]}
|
|
209
256
|
style={
|
|
210
257
|
Array [
|
|
211
258
|
Object {
|
|
212
|
-
"
|
|
213
|
-
},
|
|
214
|
-
Object {
|
|
215
|
-
"backgroundColor": "transparent",
|
|
216
|
-
},
|
|
217
|
-
Object {
|
|
218
|
-
"height": 800,
|
|
219
|
-
"width": 300,
|
|
259
|
+
"flex": 1,
|
|
220
260
|
},
|
|
221
|
-
|
|
261
|
+
undefined,
|
|
222
262
|
]
|
|
223
263
|
}
|
|
224
264
|
>
|
|
225
|
-
<
|
|
265
|
+
<RNCSafeAreaView
|
|
266
|
+
edges={
|
|
267
|
+
Object {
|
|
268
|
+
"bottom": "off",
|
|
269
|
+
"left": "off",
|
|
270
|
+
"right": "off",
|
|
271
|
+
"top": "additive",
|
|
272
|
+
}
|
|
273
|
+
}
|
|
226
274
|
style={
|
|
227
275
|
Array [
|
|
228
276
|
Object {
|
|
229
|
-
"
|
|
230
|
-
"position": "relative",
|
|
231
|
-
"zIndex": 200,
|
|
277
|
+
"backgroundColor": "transparent",
|
|
232
278
|
},
|
|
233
279
|
Object {
|
|
234
280
|
"height": 800,
|
|
235
281
|
"width": 300,
|
|
236
282
|
},
|
|
237
283
|
Object {},
|
|
238
|
-
Object {},
|
|
239
|
-
Object {},
|
|
240
284
|
]
|
|
241
285
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
"paddingTop": 20,
|
|
286
|
+
>
|
|
287
|
+
<View
|
|
288
|
+
additionalData={
|
|
289
|
+
Object {
|
|
290
|
+
"saveArea": true,
|
|
291
|
+
}
|
|
249
292
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
293
|
+
animationType="moveUpComponent"
|
|
294
|
+
style={
|
|
295
|
+
Object {
|
|
296
|
+
"flexDirection": "column",
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
>
|
|
300
|
+
<View
|
|
301
|
+
style={
|
|
302
|
+
Array [
|
|
303
|
+
Object {
|
|
304
|
+
"alignSelf": "center",
|
|
305
|
+
"position": "relative",
|
|
306
|
+
"zIndex": 200,
|
|
307
|
+
},
|
|
308
|
+
Object {
|
|
309
|
+
"aspectRatio": 1.7786666666666666,
|
|
310
|
+
"height": undefined,
|
|
311
|
+
"width": "100%",
|
|
312
|
+
},
|
|
313
|
+
Object {},
|
|
314
|
+
Object {},
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
testID="test-player-container"
|
|
318
|
+
/>
|
|
319
|
+
<View
|
|
320
|
+
style={
|
|
321
|
+
Object {
|
|
322
|
+
"flex": 1,
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/>
|
|
326
|
+
</View>
|
|
327
|
+
</RNCSafeAreaView>
|
|
328
|
+
</RNCSafeAreaProvider>
|
|
253
329
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Dimensions } from "react-native";
|
|
3
3
|
import { useIsTabletLandscape } from "@applicaster/zapp-react-native-utils/reactHooks/device/useMemoizedIsTablet";
|
|
4
4
|
import {
|
|
@@ -39,13 +39,22 @@ export const useModalSize = (): Size => {
|
|
|
39
39
|
MODAL_SIZE_FOR_PORTRAIT
|
|
40
40
|
);
|
|
41
41
|
|
|
42
|
-
const setNewModalSize = (
|
|
43
|
-
setModalSize(
|
|
42
|
+
const setNewModalSize = React.useCallback((newSize, log) => {
|
|
43
|
+
setModalSize((oldSize) => {
|
|
44
|
+
if (
|
|
45
|
+
oldSize.height === newSize.height &&
|
|
46
|
+
oldSize.width === newSize.width
|
|
47
|
+
) {
|
|
48
|
+
return oldSize;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return newSize;
|
|
52
|
+
});
|
|
44
53
|
|
|
45
54
|
logger.debug({
|
|
46
55
|
message: log,
|
|
47
56
|
});
|
|
48
|
-
};
|
|
57
|
+
}, []);
|
|
49
58
|
|
|
50
59
|
const isTabletLandscape = useIsTabletLandscape();
|
|
51
60
|
|