@applicaster/zapp-react-native-ui-components 13.0.0-alpha.5033140607 → 13.0.0-alpha.5049772260
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/AppContainer/__tests__/AppContainer.test.js +4 -6
- package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
- package/Components/AudioPlayer/AudioPlayer.tsx +7 -0
- package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
- package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
- package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +56 -113
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +39 -23
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
- package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
- package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
- package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
- package/Components/AudioPlayer/__tests__/title.test.js +3 -5
- package/Components/AudioPlayer/helpers.tsx +1 -0
- package/Components/BaseFocusable/index.ios.ts +1 -1
- package/Components/BaseFocusable/index.tsx +67 -31
- package/Components/Cell/Cell.tsx +18 -22
- package/Components/Cell/CellWithFocusable.tsx +51 -60
- package/Components/Cell/CellWrapper.tsx +18 -0
- package/Components/Cell/TvOSCellComponent.tsx +23 -30
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +13 -6
- package/Components/Cell/index.js +3 -1
- package/Components/Cell/styles.ts +17 -0
- package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +50 -50
- package/Components/CellRendererResolver/index.ts +2 -1
- package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
- package/Components/ComponentResolver/__tests__/componentResolver.test.js +26 -30
- package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
- package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
- package/Components/ErrorScreen/index.tsx +14 -6
- package/Components/Focusable/Focusable.tsx +1 -54
- package/Components/Focusable/FocusableTvOS.tsx +6 -2
- package/Components/Focusable/Touchable.tsx +19 -20
- package/Components/Focusable/index.android.tsx +10 -3
- package/Components/FocusableCell/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +34 -86
- package/Components/FocusableGroup/index.tsx +0 -3
- package/Components/FocusableList/index.tsx +26 -10
- package/Components/FocusableScrollView/index.tsx +43 -13
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +3 -0
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +76 -7
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +53 -9
- package/Components/GeneralContentScreen/utils/useEventAlerts.ts +28 -0
- package/Components/HandlePlayable/HandlePlayable.tsx +21 -27
- package/Components/Layout/TV/LayoutBackground.tsx +28 -0
- package/Components/Layout/TV/NavBarContainer.tsx +19 -23
- package/Components/Layout/TV/ScreenContainer.tsx +8 -2
- package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +3 -1
- package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +6 -5
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +12 -11
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +15 -10
- package/Components/Layout/TV/__tests__/index.test.tsx +14 -4
- package/Components/Layout/TV/index.tsx +6 -20
- package/Components/Layout/TV/index.web.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
- package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +10 -15
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +11 -7
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/const.ts +3 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +6 -6
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
- package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
- package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +11 -19
- package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +6 -235
- package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
- package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
- package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
- package/Components/MasterCell/utils/behaviorProvider.ts +136 -0
- package/Components/MasterCell/utils/index.ts +9 -135
- package/Components/ModalComponent/BottomSheetModalContent.tsx +45 -19
- package/Components/ModalComponent/Button/Item.tsx +6 -5
- package/Components/ModalComponent/Button/assets.ts +1 -1
- package/Components/ModalComponent/Button/index.tsx +30 -43
- package/Components/ModalComponent/Header/index.tsx +3 -3
- package/Components/ModalComponent/utils.ts +55 -7
- package/Components/NativeFocusables/{index.js → index.ts} +4 -2
- package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
- package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
- package/Components/OfflineHandler/utils/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +45 -25
- package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
- package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +42 -65
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
- package/Components/River/RefreshControl.tsx +1 -1
- package/Components/River/RiverFooter.tsx +39 -9
- package/Components/River/RiverItem.tsx +39 -3
- package/Components/River/TV/index.tsx +6 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +114 -45
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +21 -83
- package/Components/River/__tests__/componentsMap.test.js +64 -17
- package/Components/River/__tests__/river.test.js +75 -40
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +12 -5
- package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
- package/Components/RouteManager/__tests__/testId.test.js +8 -6
- package/Components/Screen/TV/index.web.tsx +5 -6
- package/Components/Screen/__tests__/Screen.test.tsx +41 -27
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -4
- package/Components/Screen/hooks.ts +53 -0
- package/Components/Screen/index.tsx +16 -42
- package/Components/ScreenResolver/__tests__/screenResolver.test.js +95 -70
- package/Components/Tabs/Tab.tsx +12 -9
- package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
- package/Components/TextInputTv/index.tsx +6 -5
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +2 -3
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
- package/Components/TrackedView/index.tsx +1 -0
- package/Components/Transitioner/AnimationManager.js +15 -15
- package/Components/Transitioner/Scene.tsx +53 -24
- package/Components/Transitioner/Transitioner.tsx +3 -3
- package/Components/Transitioner/__tests__/Scene.test.js +25 -14
- package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +10 -50
- package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +4 -4
- package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
- package/Components/Transitioner/index.js +8 -4
- package/Components/VideoLive/LiveImageManager.ts +27 -1
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +36 -24
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -10
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +1 -1
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +51 -31
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +8 -4
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +48 -22
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +15 -15
- package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +108 -0
- package/Components/VideoModal/ModalAnimation/const.ts +5 -0
- package/Components/VideoModal/ModalAnimation/index.ts +4 -1
- package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
- package/Components/VideoModal/ModalAnimation/utils.ts +38 -2
- package/Components/VideoModal/OpaqueLayer.tsx +33 -0
- package/Components/VideoModal/PlayerDetails.tsx +13 -10
- package/Components/VideoModal/PlayerWrapper.tsx +43 -39
- package/Components/VideoModal/VideoModal.tsx +17 -11
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +4 -4
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -156
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
- package/Components/VideoModal/hooks/index.ts +7 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
- package/Components/VideoModal/hooks/utils/index.ts +33 -0
- package/Components/VideoModal/utils.ts +6 -9
- package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
- package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
- package/Components/Viewport/__tests__/utils.test.js +5 -4
- package/Components/ZappUIComponent/Placeholder.tsx +3 -1
- package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
- package/Components/ZappUIComponent/index.tsx +4 -17
- package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
- package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
- package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
- package/Contexts/HeaderOffsetContext/index.tsx +4 -6
- package/Contexts/ScreenContext/index.tsx +6 -12
- package/Contexts/ScreenLayoutContext/index.tsx +5 -3
- package/Decorators/Analytics/{index.js → index.tsx} +11 -11
- package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
- package/Decorators/Navigator/index.tsx +1 -1
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
- package/Decorators/RiverFeedLoader/index.tsx +1 -1
- package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
- package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
- package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +27 -27
- package/Decorators/RiverResolver/index.tsx +6 -8
- package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
- package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
- package/Decorators/ZappPipesDataConnector/index.tsx +7 -3
- package/package.json +13 -11
- package/tsconfig.json +2 -3
- package/.babelrc +0 -8
- package/Components/Cell/CellStyles/FallbackCellStyle/index.js +0 -157
- package/Components/Cell/CellStyles/Hero/index.js +0 -111
- package/Components/Cell/CellStyles/ScreenSelector/index.js +0 -68
- package/Components/Cell/CellStyles/cellStylesResolver.ts +0 -19
- package/Components/Cell/CellStyles/colors.js +0 -40
- package/Components/Cell/CellStyles/index.js +0 -15
- package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
- package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
- package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
- package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
- package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
- package/Decorators/RiverFeedLoader/utils.ts +0 -100
- package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { StyleSheet,
|
|
2
|
+
import { equals } from "ramda";
|
|
3
|
+
import { StyleSheet, StatusBar, View } from "react-native";
|
|
4
4
|
|
|
5
5
|
import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
|
|
6
6
|
import {
|
|
@@ -17,20 +17,26 @@ import {
|
|
|
17
17
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks/device/useIsTablet";
|
|
18
18
|
|
|
19
19
|
import { withModalNavigationContextProvider } from "../../Contexts/ModalNavigationContext";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
import {
|
|
21
|
+
useModalSize,
|
|
22
|
+
useBackgroundColor,
|
|
23
|
+
useInitialPlayerState,
|
|
24
|
+
} from "./hooks";
|
|
25
|
+
|
|
23
26
|
import { APP_EVENTS } from "@applicaster/zapp-react-native-utils/appUtils/events";
|
|
24
|
-
import { Spinner } from "../Spinner";
|
|
25
27
|
import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
|
|
26
28
|
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
27
29
|
import { useSubscriberFor } from "@applicaster/zapp-react-native-utils/reactHooks/useSubscriberFor";
|
|
28
30
|
import { requiresAuthentication } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
29
31
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
30
32
|
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
33
|
+
import { Spinner } from "../Spinner";
|
|
34
|
+
import { OpaqueLayer } from "./OpaqueLayer";
|
|
31
35
|
|
|
32
36
|
import { AnimatedPlayerModalWrapper } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
33
37
|
|
|
38
|
+
const LOADER_BACKGROUND_COLOR = "rgba(64,64,64,0.5)";
|
|
39
|
+
|
|
34
40
|
const styles = StyleSheet.create({
|
|
35
41
|
container: {
|
|
36
42
|
top: 0,
|
|
@@ -39,7 +45,6 @@ const styles = StyleSheet.create({
|
|
|
39
45
|
bottom: 0,
|
|
40
46
|
position: "absolute",
|
|
41
47
|
},
|
|
42
|
-
// eslint-disable-next-line react-native/no-color-literals
|
|
43
48
|
loaderContainer: {
|
|
44
49
|
top: 0,
|
|
45
50
|
left: 0,
|
|
@@ -48,7 +53,7 @@ const styles = StyleSheet.create({
|
|
|
48
53
|
position: "absolute",
|
|
49
54
|
alignItems: "center",
|
|
50
55
|
justifyContent: "center",
|
|
51
|
-
backgroundColor:
|
|
56
|
+
backgroundColor: LOADER_BACKGROUND_COLOR,
|
|
52
57
|
},
|
|
53
58
|
});
|
|
54
59
|
|
|
@@ -100,7 +105,7 @@ const VideoModalComponent = () => {
|
|
|
100
105
|
|
|
101
106
|
const onHooksSuccess = ({ payload }) => {
|
|
102
107
|
// set new modified entry
|
|
103
|
-
if (!
|
|
108
|
+
if (!equals(payload, item)) {
|
|
104
109
|
onVideoModalHookSuccessAnalyticsEvent();
|
|
105
110
|
setVideoModalItem(payload);
|
|
106
111
|
}
|
|
@@ -136,6 +141,9 @@ const VideoModalComponent = () => {
|
|
|
136
141
|
|
|
137
142
|
<PathnameContext.Provider value={pathname}>
|
|
138
143
|
<ScreenContextProvider pathname={pathname}>
|
|
144
|
+
{/* Hide content underneath when we switch to next video in fullscreen mode */}
|
|
145
|
+
{mode === "FULLSCREEN" && <OpaqueLayer />}
|
|
146
|
+
|
|
139
147
|
{itemIdHooksFinished === item?.id ? (
|
|
140
148
|
<AnimatedPlayerModalWrapper
|
|
141
149
|
style={[
|
|
@@ -148,8 +156,6 @@ const VideoModalComponent = () => {
|
|
|
148
156
|
<HandlePlayable
|
|
149
157
|
item={item}
|
|
150
158
|
isModal={mode !== "PIP"}
|
|
151
|
-
modalHeight={modalSize.height}
|
|
152
|
-
modalWidth={modalSize.width}
|
|
153
159
|
mode={mode}
|
|
154
160
|
/>
|
|
155
161
|
</AnimatedPlayerModalWrapper>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import renderer from "react-test-renderer";
|
|
3
|
-
import { View } from "react-native";
|
|
4
3
|
|
|
5
4
|
const props = {
|
|
6
5
|
entry: {},
|
|
@@ -24,7 +23,11 @@ jest.mock("react-native-safe-area-context", () => ({
|
|
|
24
23
|
|
|
25
24
|
jest.mock(
|
|
26
25
|
"@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap",
|
|
27
|
-
() =>
|
|
26
|
+
() => {
|
|
27
|
+
const View = jest.requireActual("react-native").View;
|
|
28
|
+
|
|
29
|
+
return { ComponentsMap: View };
|
|
30
|
+
}
|
|
28
31
|
);
|
|
29
32
|
|
|
30
33
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/screen", () => ({
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { View } from "react-native";
|
|
4
|
-
|
|
5
3
|
import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
|
|
6
4
|
|
|
7
5
|
const props = {
|
|
@@ -17,13 +15,17 @@ const props = {
|
|
|
17
15
|
},
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
const
|
|
18
|
+
const mockUseIsDeviceTablet = jest.fn();
|
|
21
19
|
|
|
22
20
|
jest.mock("react-native");
|
|
23
21
|
|
|
24
22
|
jest.mock("react-native-gesture-handler");
|
|
25
23
|
|
|
26
|
-
jest.mock("../PlayerDetails", () =>
|
|
24
|
+
jest.mock("../PlayerDetails", () => {
|
|
25
|
+
const View = jest.requireActual("react-native").View;
|
|
26
|
+
|
|
27
|
+
return { PlayerDetails: View };
|
|
28
|
+
});
|
|
27
29
|
|
|
28
30
|
jest.mock(
|
|
29
31
|
"@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext",
|
|
@@ -33,10 +35,11 @@ jest.mock(
|
|
|
33
35
|
);
|
|
34
36
|
|
|
35
37
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/device", () => ({
|
|
36
|
-
useIsTablet,
|
|
38
|
+
useIsTablet: mockUseIsDeviceTablet,
|
|
37
39
|
}));
|
|
38
40
|
|
|
39
41
|
jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
|
|
42
|
+
...jest.requireActual("@applicaster/zapp-react-native-utils/theme"),
|
|
40
43
|
useTheme: jest.fn(() => ({})),
|
|
41
44
|
}));
|
|
42
45
|
|
|
@@ -59,7 +62,7 @@ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
|
59
62
|
})),
|
|
60
63
|
}));
|
|
61
64
|
|
|
62
|
-
jest.mock("../utils", () => ({
|
|
65
|
+
jest.mock("../utils", () => ({ playerDimensionsHack: {} }));
|
|
63
66
|
|
|
64
67
|
const { PlayerWrapper } = require("../PlayerWrapper");
|
|
65
68
|
|
|
@@ -68,7 +71,7 @@ const children = jest.fn(() => {});
|
|
|
68
71
|
|
|
69
72
|
describe("PlayerWrapper", () => {
|
|
70
73
|
it("renders properly", () => {
|
|
71
|
-
|
|
74
|
+
mockUseIsDeviceTablet.mockReturnValue(false);
|
|
72
75
|
|
|
73
76
|
const element = renderWithProviders(
|
|
74
77
|
<PlayerWrapper {...props}>{children}</PlayerWrapper>
|
|
@@ -78,7 +81,7 @@ describe("PlayerWrapper", () => {
|
|
|
78
81
|
});
|
|
79
82
|
|
|
80
83
|
it("renders inline", () => {
|
|
81
|
-
|
|
84
|
+
mockUseIsDeviceTablet.mockReturnValue(false);
|
|
82
85
|
|
|
83
86
|
const element = renderWithProviders(
|
|
84
87
|
<PlayerWrapper {...props} inline={true} isModal={true}>
|
|
@@ -90,7 +93,7 @@ describe("PlayerWrapper", () => {
|
|
|
90
93
|
});
|
|
91
94
|
|
|
92
95
|
it("renders inline on tablet in landscape orientation", () => {
|
|
93
|
-
|
|
96
|
+
mockUseIsDeviceTablet.mockReturnValue(true);
|
|
94
97
|
|
|
95
98
|
const element = renderWithProviders(
|
|
96
99
|
<PlayerWrapper {...props} inline={true} isModal={true}>
|
|
@@ -102,7 +105,7 @@ describe("PlayerWrapper", () => {
|
|
|
102
105
|
});
|
|
103
106
|
|
|
104
107
|
it("renders inline and docked", () => {
|
|
105
|
-
|
|
108
|
+
mockUseIsDeviceTablet.mockReturnValue(false);
|
|
106
109
|
|
|
107
110
|
const children = jest.fn(() => {});
|
|
108
111
|
const dimensions = { height: undefined, width: props.style.width };
|
|
@@ -4,7 +4,7 @@ exports[`PlayerDetails renders properly 1`] = `
|
|
|
4
4
|
<View
|
|
5
5
|
collapsable={false}
|
|
6
6
|
style={
|
|
7
|
-
|
|
7
|
+
{
|
|
8
8
|
"backgroundColor": "transparent",
|
|
9
9
|
"flex": 1,
|
|
10
10
|
"marginTop": -8,
|
|
@@ -15,7 +15,7 @@ exports[`PlayerDetails renders properly 1`] = `
|
|
|
15
15
|
>
|
|
16
16
|
<View
|
|
17
17
|
feed="test-source"
|
|
18
|
-
riverComponents={
|
|
18
|
+
riverComponents={[]}
|
|
19
19
|
riverId="test-id"
|
|
20
20
|
/>
|
|
21
21
|
</View>
|
|
@@ -25,7 +25,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
|
|
|
25
25
|
<View
|
|
26
26
|
collapsable={false}
|
|
27
27
|
style={
|
|
28
|
-
|
|
28
|
+
{
|
|
29
29
|
"backgroundColor": "transparent",
|
|
30
30
|
"flex": 1,
|
|
31
31
|
"marginTop": -20,
|
|
@@ -36,7 +36,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
|
|
|
36
36
|
>
|
|
37
37
|
<View
|
|
38
38
|
feed="test-source"
|
|
39
|
-
riverComponents={
|
|
39
|
+
riverComponents={[]}
|
|
40
40
|
riverId="test-id"
|
|
41
41
|
/>
|
|
42
42
|
</View>
|
|
@@ -4,8 +4,8 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
4
4
|
<RNCSafeAreaProvider
|
|
5
5
|
onInsetsChange={[Function]}
|
|
6
6
|
style={
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
[
|
|
8
|
+
{
|
|
9
9
|
"flex": 1,
|
|
10
10
|
},
|
|
11
11
|
undefined,
|
|
@@ -14,7 +14,7 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
14
14
|
>
|
|
15
15
|
<RNCSafeAreaView
|
|
16
16
|
edges={
|
|
17
|
-
|
|
17
|
+
{
|
|
18
18
|
"bottom": "off",
|
|
19
19
|
"left": "off",
|
|
20
20
|
"right": "off",
|
|
@@ -22,31 +22,31 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
style={
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
27
|
"backgroundColor": "transparent",
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
{
|
|
30
30
|
"height": 800,
|
|
31
31
|
"width": 300,
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
{},
|
|
34
34
|
]
|
|
35
35
|
}
|
|
36
36
|
>
|
|
37
37
|
<View
|
|
38
38
|
additionalData={
|
|
39
|
-
|
|
39
|
+
{
|
|
40
40
|
"saveArea": true,
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
animationType="moveUpComponent"
|
|
44
44
|
style={
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
[
|
|
46
|
+
{
|
|
47
47
|
"flexDirection": "column",
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
{
|
|
50
50
|
"flex": 1,
|
|
51
51
|
},
|
|
52
52
|
]
|
|
@@ -54,53 +54,23 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
54
54
|
>
|
|
55
55
|
<View
|
|
56
56
|
style={
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
[
|
|
58
|
+
{
|
|
59
59
|
"alignSelf": "center",
|
|
60
60
|
"position": "relative",
|
|
61
61
|
"zIndex": 200,
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
{
|
|
64
64
|
"aspectRatio": 1.7777777777777777,
|
|
65
65
|
"height": undefined,
|
|
66
66
|
"width": "100%",
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
{},
|
|
69
|
+
{},
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
testID="test-player-container"
|
|
73
73
|
/>
|
|
74
|
-
<View
|
|
75
|
-
animationType="componentFade"
|
|
76
|
-
style={
|
|
77
|
-
Object {
|
|
78
|
-
"flex": 1,
|
|
79
|
-
}
|
|
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>
|
|
104
74
|
</View>
|
|
105
75
|
</RNCSafeAreaView>
|
|
106
76
|
</RNCSafeAreaProvider>
|
|
@@ -110,8 +80,8 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
110
80
|
<RNCSafeAreaProvider
|
|
111
81
|
onInsetsChange={[Function]}
|
|
112
82
|
style={
|
|
113
|
-
|
|
114
|
-
|
|
83
|
+
[
|
|
84
|
+
{
|
|
115
85
|
"flex": 1,
|
|
116
86
|
},
|
|
117
87
|
undefined,
|
|
@@ -120,7 +90,7 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
120
90
|
>
|
|
121
91
|
<RNCSafeAreaView
|
|
122
92
|
edges={
|
|
123
|
-
|
|
93
|
+
{
|
|
124
94
|
"bottom": "off",
|
|
125
95
|
"left": "off",
|
|
126
96
|
"right": "off",
|
|
@@ -128,31 +98,31 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
128
98
|
}
|
|
129
99
|
}
|
|
130
100
|
style={
|
|
131
|
-
|
|
132
|
-
|
|
101
|
+
[
|
|
102
|
+
{
|
|
133
103
|
"backgroundColor": "transparent",
|
|
134
104
|
},
|
|
135
|
-
|
|
105
|
+
{
|
|
136
106
|
"height": undefined,
|
|
137
107
|
"width": 300,
|
|
138
108
|
},
|
|
139
|
-
|
|
109
|
+
{},
|
|
140
110
|
]
|
|
141
111
|
}
|
|
142
112
|
>
|
|
143
113
|
<View
|
|
144
114
|
additionalData={
|
|
145
|
-
|
|
115
|
+
{
|
|
146
116
|
"saveArea": true,
|
|
147
117
|
}
|
|
148
118
|
}
|
|
149
119
|
animationType="moveUpComponent"
|
|
150
120
|
style={
|
|
151
|
-
|
|
152
|
-
|
|
121
|
+
[
|
|
122
|
+
{
|
|
153
123
|
"flexDirection": "column",
|
|
154
124
|
},
|
|
155
|
-
|
|
125
|
+
{
|
|
156
126
|
"flex": 1,
|
|
157
127
|
},
|
|
158
128
|
]
|
|
@@ -160,53 +130,23 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
160
130
|
>
|
|
161
131
|
<View
|
|
162
132
|
style={
|
|
163
|
-
|
|
164
|
-
|
|
133
|
+
[
|
|
134
|
+
{
|
|
165
135
|
"alignSelf": "center",
|
|
166
136
|
"position": "relative",
|
|
167
137
|
"zIndex": 200,
|
|
168
138
|
},
|
|
169
|
-
|
|
139
|
+
{
|
|
170
140
|
"aspectRatio": undefined,
|
|
171
141
|
"height": undefined,
|
|
172
142
|
"width": "100%",
|
|
173
143
|
},
|
|
174
|
-
|
|
175
|
-
|
|
144
|
+
{},
|
|
145
|
+
{},
|
|
176
146
|
]
|
|
177
147
|
}
|
|
178
148
|
testID="test-player-container"
|
|
179
149
|
/>
|
|
180
|
-
<View
|
|
181
|
-
animationType="componentFade"
|
|
182
|
-
style={
|
|
183
|
-
Object {
|
|
184
|
-
"flex": 1,
|
|
185
|
-
}
|
|
186
|
-
}
|
|
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>
|
|
210
150
|
</View>
|
|
211
151
|
</RNCSafeAreaView>
|
|
212
152
|
</RNCSafeAreaProvider>
|
|
@@ -216,8 +156,8 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
216
156
|
<RNCSafeAreaProvider
|
|
217
157
|
onInsetsChange={[Function]}
|
|
218
158
|
style={
|
|
219
|
-
|
|
220
|
-
|
|
159
|
+
[
|
|
160
|
+
{
|
|
221
161
|
"flex": 1,
|
|
222
162
|
},
|
|
223
163
|
undefined,
|
|
@@ -226,7 +166,7 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
226
166
|
>
|
|
227
167
|
<RNCSafeAreaView
|
|
228
168
|
edges={
|
|
229
|
-
|
|
169
|
+
{
|
|
230
170
|
"bottom": "off",
|
|
231
171
|
"left": "off",
|
|
232
172
|
"right": "off",
|
|
@@ -234,31 +174,31 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
234
174
|
}
|
|
235
175
|
}
|
|
236
176
|
style={
|
|
237
|
-
|
|
238
|
-
|
|
177
|
+
[
|
|
178
|
+
{
|
|
239
179
|
"backgroundColor": "red",
|
|
240
180
|
},
|
|
241
|
-
|
|
181
|
+
{
|
|
242
182
|
"height": 800,
|
|
243
183
|
"width": 300,
|
|
244
184
|
},
|
|
245
|
-
|
|
185
|
+
{},
|
|
246
186
|
]
|
|
247
187
|
}
|
|
248
188
|
>
|
|
249
189
|
<View
|
|
250
190
|
additionalData={
|
|
251
|
-
|
|
191
|
+
{
|
|
252
192
|
"saveArea": true,
|
|
253
193
|
}
|
|
254
194
|
}
|
|
255
195
|
animationType="moveUpComponent"
|
|
256
196
|
style={
|
|
257
|
-
|
|
258
|
-
|
|
197
|
+
[
|
|
198
|
+
{
|
|
259
199
|
"flexDirection": "row",
|
|
260
200
|
},
|
|
261
|
-
|
|
201
|
+
{
|
|
262
202
|
"flex": 1,
|
|
263
203
|
},
|
|
264
204
|
]
|
|
@@ -266,26 +206,26 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
266
206
|
>
|
|
267
207
|
<View
|
|
268
208
|
style={
|
|
269
|
-
|
|
270
|
-
|
|
209
|
+
[
|
|
210
|
+
{
|
|
271
211
|
"alignSelf": "center",
|
|
272
212
|
"position": "relative",
|
|
273
213
|
"zIndex": 200,
|
|
274
214
|
},
|
|
275
|
-
|
|
215
|
+
{
|
|
276
216
|
"aspectRatio": 1.7777777777777777,
|
|
277
217
|
"height": undefined,
|
|
278
218
|
"width": 195,
|
|
279
219
|
},
|
|
280
|
-
|
|
281
|
-
|
|
220
|
+
{},
|
|
221
|
+
{},
|
|
282
222
|
]
|
|
283
223
|
}
|
|
284
224
|
testID="test-player-container"
|
|
285
225
|
>
|
|
286
226
|
<View
|
|
287
227
|
additionalData={
|
|
288
|
-
|
|
228
|
+
{
|
|
289
229
|
"disableAnimatedComponent": false,
|
|
290
230
|
"resetAnimationValue": undefined,
|
|
291
231
|
"useLayoutMeasure": true,
|
|
@@ -293,38 +233,8 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
293
233
|
}
|
|
294
234
|
animationType="moveUpComponent"
|
|
295
235
|
style={
|
|
296
|
-
|
|
297
|
-
"flex": 1,
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
/>
|
|
301
|
-
</View>
|
|
302
|
-
<View
|
|
303
|
-
animationType="componentFade"
|
|
304
|
-
style={
|
|
305
|
-
Object {
|
|
306
|
-
"flex": 1,
|
|
307
|
-
}
|
|
308
|
-
}
|
|
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 {
|
|
236
|
+
{
|
|
326
237
|
"flex": 1,
|
|
327
|
-
"paddingTop": 20,
|
|
328
238
|
}
|
|
329
239
|
}
|
|
330
240
|
/>
|
|
@@ -338,8 +248,8 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
338
248
|
<RNCSafeAreaProvider
|
|
339
249
|
onInsetsChange={[Function]}
|
|
340
250
|
style={
|
|
341
|
-
|
|
342
|
-
|
|
251
|
+
[
|
|
252
|
+
{
|
|
343
253
|
"flex": 1,
|
|
344
254
|
},
|
|
345
255
|
undefined,
|
|
@@ -348,7 +258,7 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
348
258
|
>
|
|
349
259
|
<RNCSafeAreaView
|
|
350
260
|
edges={
|
|
351
|
-
|
|
261
|
+
{
|
|
352
262
|
"bottom": "off",
|
|
353
263
|
"left": "off",
|
|
354
264
|
"right": "off",
|
|
@@ -356,31 +266,31 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
356
266
|
}
|
|
357
267
|
}
|
|
358
268
|
style={
|
|
359
|
-
|
|
360
|
-
|
|
269
|
+
[
|
|
270
|
+
{
|
|
361
271
|
"backgroundColor": "transparent",
|
|
362
272
|
},
|
|
363
|
-
|
|
273
|
+
{
|
|
364
274
|
"height": 800,
|
|
365
275
|
"width": 300,
|
|
366
276
|
},
|
|
367
|
-
|
|
277
|
+
{},
|
|
368
278
|
]
|
|
369
279
|
}
|
|
370
280
|
>
|
|
371
281
|
<View
|
|
372
282
|
additionalData={
|
|
373
|
-
|
|
283
|
+
{
|
|
374
284
|
"saveArea": true,
|
|
375
285
|
}
|
|
376
286
|
}
|
|
377
287
|
animationType="moveUpComponent"
|
|
378
288
|
style={
|
|
379
|
-
|
|
380
|
-
|
|
289
|
+
[
|
|
290
|
+
{
|
|
381
291
|
"flexDirection": "column",
|
|
382
292
|
},
|
|
383
|
-
|
|
293
|
+
{
|
|
384
294
|
"flex": 1,
|
|
385
295
|
},
|
|
386
296
|
]
|
|
@@ -388,19 +298,19 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
388
298
|
>
|
|
389
299
|
<View
|
|
390
300
|
style={
|
|
391
|
-
|
|
392
|
-
|
|
301
|
+
[
|
|
302
|
+
{
|
|
393
303
|
"alignSelf": "center",
|
|
394
304
|
"position": "relative",
|
|
395
305
|
"zIndex": 200,
|
|
396
306
|
},
|
|
397
|
-
|
|
307
|
+
{
|
|
398
308
|
"aspectRatio": 1.7786666666666666,
|
|
399
309
|
"height": undefined,
|
|
400
310
|
"width": "100%",
|
|
401
311
|
},
|
|
402
|
-
|
|
403
|
-
|
|
312
|
+
{},
|
|
313
|
+
{},
|
|
404
314
|
]
|
|
405
315
|
}
|
|
406
316
|
testID="test-player-container"
|