@applicaster/zapp-react-native-ui-components 13.0.0-rc.14 → 13.0.0-rc.141
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/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap +66 -0
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/tv/Artwork.tsx +40 -0
- package/Components/AudioPlayer/{AudioPlayerLayout.tsx → tv/Layout.tsx} +37 -79
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +2 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +12 -9
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +12 -9
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +5 -8
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +6 -6
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +11 -6
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +170 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/channel.test.js.snap +3 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +3 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +3 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +3 -5
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +9 -7
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +3 -5
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +3 -5
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +3 -5
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +3 -5
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +14 -63
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/BaseFocusable/index.ios.ts +1 -1
- package/Components/BaseFocusable/index.tsx +67 -31
- package/Components/Cell/Cell.tsx +14 -14
- package/Components/Cell/CellWithFocusable.tsx +50 -59
- package/Components/Cell/CellWrapper.tsx +18 -0
- package/Components/Cell/TvOSCellComponent.tsx +20 -26
- 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 +9 -0
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +5 -3
- package/Components/GeneralContentScreen/utils/useEventAlerts.ts +30 -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 +66 -54
- package/Components/ModalComponent/Button/Item.tsx +6 -5
- package/Components/ModalComponent/Button/assets.ts +1 -1
- package/Components/ModalComponent/Button/index.tsx +45 -62
- package/Components/ModalComponent/Header/index.tsx +12 -11
- package/Components/ModalComponent/utils.ts +55 -7
- 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 +76 -66
- package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
- package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +2 -2
- package/Components/River/ComponentsMap/ComponentsMap.tsx +49 -68
- 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 +44 -4
- package/Components/River/TV/index.tsx +6 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +115 -46
- 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/TestId.tsx +1 -5
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -5
- package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
- package/Components/RouteManager/__tests__/testId.test.js +4 -6
- package/Components/Screen/TV/__tests__/index.web.test.tsx +26 -0
- package/Components/Screen/TV/index.web.tsx +5 -6
- package/Components/Screen/__tests__/Screen.test.tsx +53 -31
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +6 -6
- 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 -23
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +16 -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 +32 -2
- package/Components/VideoModal/OpaqueLayer.tsx +33 -0
- package/Components/VideoModal/PlayerDetails.tsx +18 -10
- package/Components/VideoModal/PlayerWrapper.tsx +51 -57
- 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 +2 -40
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +74 -104
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +51 -0
- package/Components/VideoModal/hooks/index.ts +7 -0
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +38 -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/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/AudioPlayer/Artwork.tsx +0 -35
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +0 -123
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -50
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -27
- package/Components/AudioPlayer/index.ts +0 -1
- 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
- /package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +0 -0
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
2
|
-
import { PluginConfiguration } from "./
|
|
2
|
+
import { PluginConfiguration } from "./";
|
|
3
|
+
import { ItemIconProps } from "./Button/ItemIcon";
|
|
4
|
+
import { ItemLabelProps } from "./Button/ItemLabel";
|
|
5
|
+
import { ItemProps } from "./Button/Item";
|
|
3
6
|
|
|
4
7
|
export function defaultItemProps(
|
|
5
8
|
config: PluginConfiguration,
|
|
6
9
|
maxWidth: number
|
|
7
|
-
) {
|
|
10
|
+
): ItemProps {
|
|
8
11
|
const {
|
|
9
12
|
modal_bottom_sheet_item_background_color,
|
|
10
13
|
modal_bottom_sheet_item_focus_background_color,
|
|
11
14
|
modal_bottom_sheet_item_selected_background_color,
|
|
12
|
-
|
|
15
|
+
modal_bottom_sheet_item_focused_selected_background_color,
|
|
13
16
|
modal_bottom_sheet_item_corner_radius,
|
|
14
17
|
modal_bottom_sheet_item_margin_bottom,
|
|
15
18
|
modal_bottom_sheet_item_margin_left,
|
|
@@ -25,8 +28,8 @@ export function defaultItemProps(
|
|
|
25
28
|
backgroundColor: modal_bottom_sheet_item_background_color,
|
|
26
29
|
focusedBackgroundColor: modal_bottom_sheet_item_focus_background_color,
|
|
27
30
|
selectedBackgroundColor: modal_bottom_sheet_item_selected_background_color,
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
focusedSelectedBackgroundColor:
|
|
32
|
+
modal_bottom_sheet_item_focused_selected_background_color,
|
|
30
33
|
borderRadius: modal_bottom_sheet_item_corner_radius,
|
|
31
34
|
marginBottom: modal_bottom_sheet_item_margin_bottom,
|
|
32
35
|
marginTop: modal_bottom_sheet_item_margin_top,
|
|
@@ -43,7 +46,7 @@ export function defaultItemProps(
|
|
|
43
46
|
export function defaultItemLabelProps(
|
|
44
47
|
config: PluginConfiguration,
|
|
45
48
|
sheetWidth: number
|
|
46
|
-
) {
|
|
49
|
+
): ItemLabelProps {
|
|
47
50
|
const {
|
|
48
51
|
modal_bottom_sheet_item_label_android_letter_spacing,
|
|
49
52
|
modal_bottom_sheet_item_label_ios_letter_spacing,
|
|
@@ -103,7 +106,9 @@ export function defaultItemLabelProps(
|
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
export function defaultItemIconProps(
|
|
109
|
+
export function defaultItemIconProps(
|
|
110
|
+
config: PluginConfiguration
|
|
111
|
+
): ItemIconProps {
|
|
107
112
|
const {
|
|
108
113
|
modal_bottom_sheet_item_icon_height,
|
|
109
114
|
modal_bottom_sheet_item_icon_width,
|
|
@@ -124,3 +129,46 @@ export function defaultItemIconProps(config: PluginConfiguration) {
|
|
|
124
129
|
marginRight: modal_bottom_sheet_item_icon_margin_right,
|
|
125
130
|
};
|
|
126
131
|
}
|
|
132
|
+
|
|
133
|
+
export function getItemIconProps(
|
|
134
|
+
theme: PluginConfiguration,
|
|
135
|
+
iconProps?: ((theme: PluginConfiguration) => ItemIconProps) | ItemIconProps
|
|
136
|
+
) {
|
|
137
|
+
if (iconProps) {
|
|
138
|
+
return typeof iconProps === "function" ? iconProps(theme) : iconProps;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return defaultItemIconProps(theme);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function getItemLabelProps(
|
|
145
|
+
theme: PluginConfiguration,
|
|
146
|
+
width: number,
|
|
147
|
+
labelProps?:
|
|
148
|
+
| ((theme: PluginConfiguration, width: number) => ItemLabelProps)
|
|
149
|
+
| ItemLabelProps
|
|
150
|
+
) {
|
|
151
|
+
if (labelProps) {
|
|
152
|
+
return typeof labelProps === "function"
|
|
153
|
+
? labelProps(theme, width)
|
|
154
|
+
: labelProps;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return defaultItemLabelProps(theme, width);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function getItemProps(
|
|
161
|
+
theme: PluginConfiguration,
|
|
162
|
+
width: number,
|
|
163
|
+
itemProps?:
|
|
164
|
+
| ((theme: PluginConfiguration, width: number) => ItemProps)
|
|
165
|
+
| ItemProps
|
|
166
|
+
) {
|
|
167
|
+
if (itemProps) {
|
|
168
|
+
return typeof itemProps === "function"
|
|
169
|
+
? itemProps(theme, width)
|
|
170
|
+
: itemProps;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return defaultItemProps(theme, width);
|
|
174
|
+
}
|
|
@@ -90,7 +90,7 @@ export const NotificationView = (props: Props) => {
|
|
|
90
90
|
return (
|
|
91
91
|
<div onClick={onClose}>
|
|
92
92
|
{children}
|
|
93
|
-
{open
|
|
93
|
+
{open ? (
|
|
94
94
|
<div style={styles.body}>
|
|
95
95
|
<div style={styles.title}>
|
|
96
96
|
<h2>{MSG}</h2>
|
|
@@ -98,7 +98,7 @@ export const NotificationView = (props: Props) => {
|
|
|
98
98
|
|
|
99
99
|
<h4 style={styles.subtitle}>{EXTRA_MSG}</h4>
|
|
100
100
|
</div>
|
|
101
|
-
)}
|
|
101
|
+
) : null}
|
|
102
102
|
</div>
|
|
103
103
|
);
|
|
104
104
|
};
|
|
@@ -85,7 +85,7 @@ export const NotificationView = (props: Props) => {
|
|
|
85
85
|
return (
|
|
86
86
|
<div onClick={onClose}>
|
|
87
87
|
{children}
|
|
88
|
-
{shown
|
|
88
|
+
{shown ? (
|
|
89
89
|
<div style={styles.body}>
|
|
90
90
|
<div style={styles.title}>
|
|
91
91
|
<h2>{title}</h2>
|
|
@@ -93,7 +93,7 @@ export const NotificationView = (props: Props) => {
|
|
|
93
93
|
|
|
94
94
|
<h4 style={styles.subtitle}>{subtitle}</h4>
|
|
95
95
|
</div>
|
|
96
|
-
)}
|
|
96
|
+
) : null}
|
|
97
97
|
</div>
|
|
98
98
|
);
|
|
99
99
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text, Animated } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { shallow } from "enzyme";
|
|
5
4
|
import renderer from "react-test-renderer";
|
|
6
5
|
|
|
7
6
|
jest.useFakeTimers();
|
|
@@ -40,10 +39,6 @@ const {
|
|
|
40
39
|
} = require("../NotificationView");
|
|
41
40
|
|
|
42
41
|
describe("NotificationView", () => {
|
|
43
|
-
it("renders", () => {
|
|
44
|
-
shallow(<NotificationView dismiss={dismiss} />);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
42
|
it("Show online message when Online", () => {
|
|
48
43
|
const component = renderer.create(
|
|
49
44
|
<NotificationView online dismiss={dismiss} />
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`OfflineHandler renders 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
{
|
|
7
7
|
"flex": 1,
|
|
8
8
|
"position": "relative",
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
11
11
|
>
|
|
12
12
|
<View
|
|
13
13
|
style={
|
|
14
|
-
|
|
14
|
+
{
|
|
15
15
|
"bottom": 0,
|
|
16
16
|
"left": 0,
|
|
17
17
|
"position": "absolute",
|
|
@@ -32,7 +32,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
32
32
|
onResponderTerminationRequest={[Function]}
|
|
33
33
|
onStartShouldSetResponder={[Function]}
|
|
34
34
|
style={
|
|
35
|
-
|
|
35
|
+
{
|
|
36
36
|
"alignItems": "center",
|
|
37
37
|
"backgroundColor": undefined,
|
|
38
38
|
"flex": 1,
|
|
@@ -43,8 +43,8 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
43
43
|
"position": "absolute",
|
|
44
44
|
"right": 0,
|
|
45
45
|
"top": 0,
|
|
46
|
-
"transform":
|
|
47
|
-
|
|
46
|
+
"transform": [
|
|
47
|
+
{
|
|
48
48
|
"translateY": -88,
|
|
49
49
|
},
|
|
50
50
|
],
|
|
@@ -54,7 +54,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
54
54
|
>
|
|
55
55
|
<View
|
|
56
56
|
style={
|
|
57
|
-
|
|
57
|
+
{
|
|
58
58
|
"backgroundColor": undefined,
|
|
59
59
|
"height": 44,
|
|
60
60
|
}
|
|
@@ -62,7 +62,7 @@ exports[`OfflineHandler renders 1`] = `
|
|
|
62
62
|
/>
|
|
63
63
|
<Text
|
|
64
64
|
style={
|
|
65
|
-
|
|
65
|
+
{
|
|
66
66
|
"color": undefined,
|
|
67
67
|
"fontFamily": undefined,
|
|
68
68
|
"fontSize": undefined,
|
|
@@ -2,43 +2,46 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
import renderer, { act } from "react-test-renderer";
|
|
4
4
|
|
|
5
|
-
jest.useFakeTimers();
|
|
5
|
+
jest.useFakeTimers({ legacyFakeTimers: true });
|
|
6
6
|
|
|
7
|
-
let
|
|
8
|
-
const
|
|
7
|
+
let mockConnectionStatus = false;
|
|
8
|
+
const mockPreviousValue = null;
|
|
9
9
|
|
|
10
10
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/connection", () => {
|
|
11
11
|
return {
|
|
12
|
-
useConnectionInfo: jest.fn(() =>
|
|
12
|
+
useConnectionInfo: jest.fn(() => mockConnectionStatus),
|
|
13
13
|
};
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/utils", () => {
|
|
17
17
|
return {
|
|
18
|
-
usePrevious: jest.fn(() =>
|
|
18
|
+
usePrevious: jest.fn(() => mockPreviousValue),
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
jest.mock(
|
|
23
|
-
usePickFromState
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
jest.mock(
|
|
23
|
+
"@applicaster/zapp-react-native-redux/hooks/usePickFromState",
|
|
24
|
+
() => ({
|
|
25
|
+
usePickFromState: () => ({
|
|
26
|
+
plugins: [
|
|
27
|
+
{
|
|
28
|
+
name: "offline experience",
|
|
29
|
+
identifier: "offline-experience",
|
|
30
|
+
type: "general",
|
|
31
|
+
module: {
|
|
32
|
+
useOfflineExperienceConfiguration: () => ({
|
|
33
|
+
configurationFields: {},
|
|
34
|
+
localizations: {
|
|
35
|
+
offline_toast_message: "No internet connection",
|
|
36
|
+
online_toast_message: "You are back online",
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
37
40
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
|
|
41
|
+
],
|
|
42
|
+
}),
|
|
43
|
+
})
|
|
44
|
+
);
|
|
42
45
|
|
|
43
46
|
jest.mock("react-native-safe-area-context", () => ({
|
|
44
47
|
useSafeAreaInsets: () => ({ top: 44 }),
|
|
@@ -53,7 +56,7 @@ describe("OfflineHandler", () => {
|
|
|
53
56
|
});
|
|
54
57
|
|
|
55
58
|
it("renders Notification mode if component was rendered while online", () => {
|
|
56
|
-
|
|
59
|
+
mockConnectionStatus = true;
|
|
57
60
|
|
|
58
61
|
let instance;
|
|
59
62
|
|
|
@@ -57,7 +57,7 @@ export const useNotificationHeight = () => {
|
|
|
57
57
|
|
|
58
58
|
const navBarHeight = platformSelect({ ios: 44, android: 56 });
|
|
59
59
|
|
|
60
|
-
const statusHeight =
|
|
60
|
+
const statusHeight = insets.top;
|
|
61
61
|
const notificationHeight = statusHeight + navBarHeight;
|
|
62
62
|
|
|
63
63
|
return { statusHeight, notificationHeight };
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { useEffect, useReducer } from "react";
|
|
2
3
|
// @ts-ignore
|
|
3
|
-
import { View, ViewStyle
|
|
4
|
+
import { TVMenuControl, View, ViewStyle } from "react-native";
|
|
4
5
|
import * as R from "ramda";
|
|
5
6
|
import uuid from "uuid/v4";
|
|
6
7
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
7
8
|
import {
|
|
8
|
-
isApplePlatform,
|
|
9
|
-
platformSelect,
|
|
10
9
|
isTV,
|
|
10
|
+
platformSelect,
|
|
11
|
+
isAndroidTVPlatform,
|
|
12
|
+
isTvOSPlatform,
|
|
11
13
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
14
|
+
import {
|
|
15
|
+
isAudioItem,
|
|
16
|
+
isInlineTV as isInlineTVUtil,
|
|
17
|
+
} from "@applicaster/zapp-react-native-utils/playerUtils";
|
|
12
18
|
|
|
13
19
|
import { TVEventHandlerComponent } from "@applicaster/zapp-react-native-tvos-ui-components/Components/TVEventHandlerComponent";
|
|
14
|
-
import { useEffect, useReducer } from "react";
|
|
15
20
|
import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
|
|
16
21
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
17
22
|
import {
|
|
@@ -20,7 +25,7 @@ import {
|
|
|
20
25
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
21
26
|
|
|
22
27
|
import { PlayerStateContext } from "../../Contexts/PlayerStateContext";
|
|
23
|
-
|
|
28
|
+
|
|
24
29
|
import {
|
|
25
30
|
QUICK_BRICK_EVENTS,
|
|
26
31
|
QuickBrickEvent,
|
|
@@ -29,16 +34,14 @@ import {
|
|
|
29
34
|
import { ProgramInfo } from "./ProgramInfo";
|
|
30
35
|
import { AudioPlayer } from "../AudioPlayer";
|
|
31
36
|
import {
|
|
32
|
-
playerContainerLogger,
|
|
33
37
|
log_debug,
|
|
34
38
|
log_info,
|
|
35
39
|
log_warning,
|
|
40
|
+
playerContainerLogger,
|
|
36
41
|
} from "./logger";
|
|
37
42
|
import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
useTargetScreenData,
|
|
41
|
-
} from "@applicaster/zapp-react-native-utils/reactHooks/screen";
|
|
43
|
+
import { useSetNavbarState } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
44
|
+
import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
|
|
42
45
|
import {
|
|
43
46
|
PlayerContainerContext,
|
|
44
47
|
PlayerContainerContextProvider,
|
|
@@ -55,8 +58,8 @@ import { usePlayNextOverlay } from "@applicaster/zapp-react-native-utils/appUtil
|
|
|
55
58
|
import { PlayNextState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/OverlayObserver/OverlaysObserver";
|
|
56
59
|
|
|
57
60
|
import {
|
|
58
|
-
useModalAnimationContext,
|
|
59
61
|
PlayerAnimationStateEnum,
|
|
62
|
+
useModalAnimationContext,
|
|
60
63
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
61
64
|
|
|
62
65
|
type Props = {
|
|
@@ -95,6 +98,30 @@ export type PlayNextData = {
|
|
|
95
98
|
|
|
96
99
|
const focusableBottomContainerId = "player-container-bottom";
|
|
97
100
|
|
|
101
|
+
const isAndroidTV = isAndroidTVPlatform();
|
|
102
|
+
|
|
103
|
+
const isTvOS = isTvOSPlatform();
|
|
104
|
+
|
|
105
|
+
// height for container with additional content below player
|
|
106
|
+
const INLINE_CONTAINER_CONTENT_HEIGHT = 400;
|
|
107
|
+
|
|
108
|
+
// Default Y offset for anchor points on non-Android TV platforms
|
|
109
|
+
const DEFAULT_OFFSET_Y = -600;
|
|
110
|
+
|
|
111
|
+
const EXTRA_ANCHOR_POINT_Y_OFFSET = isAndroidTV ? 0 : DEFAULT_OFFSET_Y;
|
|
112
|
+
|
|
113
|
+
const withBorderHack = () => {
|
|
114
|
+
if (isAndroidTV) {
|
|
115
|
+
/* @HACK: see GH#7269 */
|
|
116
|
+
return {
|
|
117
|
+
borderWidth: 1,
|
|
118
|
+
borderColor: "transparent",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {};
|
|
123
|
+
};
|
|
124
|
+
|
|
98
125
|
// Styles
|
|
99
126
|
const webStyles = {
|
|
100
127
|
focusableGroup: {
|
|
@@ -112,7 +139,7 @@ const webStyles = {
|
|
|
112
139
|
flex: "initial",
|
|
113
140
|
},
|
|
114
141
|
inlineRiver: {
|
|
115
|
-
height:
|
|
142
|
+
height: INLINE_CONTAINER_CONTENT_HEIGHT,
|
|
116
143
|
},
|
|
117
144
|
};
|
|
118
145
|
|
|
@@ -130,7 +157,7 @@ const nativeStyles = {
|
|
|
130
157
|
flex: 1,
|
|
131
158
|
},
|
|
132
159
|
inlineRiver: {
|
|
133
|
-
height:
|
|
160
|
+
height: INLINE_CONTAINER_CONTENT_HEIGHT,
|
|
134
161
|
},
|
|
135
162
|
};
|
|
136
163
|
|
|
@@ -150,12 +177,11 @@ const renderApplePlayer = ({
|
|
|
150
177
|
videoStyle,
|
|
151
178
|
playNextData,
|
|
152
179
|
}) => {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (!isAppleTV() || !player) {
|
|
180
|
+
if (!isTvOS || !player) {
|
|
156
181
|
return null;
|
|
157
182
|
}
|
|
158
183
|
|
|
184
|
+
// render audio_player for tvos
|
|
159
185
|
if (isAudioContent) {
|
|
160
186
|
return (
|
|
161
187
|
<AudioPlayer
|
|
@@ -169,6 +195,8 @@ const renderApplePlayer = ({
|
|
|
169
195
|
return null;
|
|
170
196
|
}
|
|
171
197
|
|
|
198
|
+
const { title, summary } = item || {};
|
|
199
|
+
|
|
172
200
|
return (
|
|
173
201
|
<ProgramInfo
|
|
174
202
|
title={title}
|
|
@@ -179,21 +207,6 @@ const renderApplePlayer = ({
|
|
|
179
207
|
);
|
|
180
208
|
};
|
|
181
209
|
|
|
182
|
-
const renderRestPlayers = ({ item, showAudioPlayer, pluginConfiguration }) => {
|
|
183
|
-
if (isApplePlatform()) {
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return (
|
|
188
|
-
showAudioPlayer && (
|
|
189
|
-
<AudioPlayer
|
|
190
|
-
audio_item={item}
|
|
191
|
-
plugin_configuration={pluginConfiguration}
|
|
192
|
-
/>
|
|
193
|
-
)
|
|
194
|
-
);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
210
|
const PlayerContainerComponent = (props: Props) => {
|
|
198
211
|
const {
|
|
199
212
|
Player,
|
|
@@ -323,7 +336,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
323
336
|
|
|
324
337
|
setState({ error: errorObj });
|
|
325
338
|
|
|
326
|
-
if (!
|
|
339
|
+
if (!isTvOS) {
|
|
327
340
|
setTimeout(() => {
|
|
328
341
|
close();
|
|
329
342
|
}, 800);
|
|
@@ -337,9 +350,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
337
350
|
|
|
338
351
|
const resumeTime = Number(item?.extensions?.resumeTime);
|
|
339
352
|
|
|
340
|
-
//
|
|
353
|
+
// Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast
|
|
341
354
|
if (
|
|
342
|
-
|
|
355
|
+
!playerManager.getActivePlayer()?.hasResumePosition() &&
|
|
343
356
|
!isNaN(resumeTime)
|
|
344
357
|
) {
|
|
345
358
|
player?.seekTo(resumeTime);
|
|
@@ -382,7 +395,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
382
395
|
}
|
|
383
396
|
};
|
|
384
397
|
|
|
385
|
-
const playerRemoteHandler = (
|
|
398
|
+
const playerRemoteHandler = (event, isLanguageOverlayVisible) => {
|
|
386
399
|
const { eventType } = event;
|
|
387
400
|
|
|
388
401
|
if (!isLanguageOverlayVisible && eventType === "menu") {
|
|
@@ -480,9 +493,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
480
493
|
// TODO: Skip hook call on TV platform
|
|
481
494
|
useBackHandler(backHandler);
|
|
482
495
|
|
|
483
|
-
const isAudioContent =
|
|
484
|
-
typeof item?.content?.type === "string" &&
|
|
485
|
-
item?.content?.type.includes("audio");
|
|
496
|
+
const isAudioContent = isAudioItem(item);
|
|
486
497
|
|
|
487
498
|
useEffect(() => {
|
|
488
499
|
if (!isAudioContent) {
|
|
@@ -516,6 +527,12 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
516
527
|
useEffect(() => {
|
|
517
528
|
playerEvent("source_changed", { item });
|
|
518
529
|
|
|
530
|
+
return () => {
|
|
531
|
+
playerEvent("player_did_close", { item });
|
|
532
|
+
};
|
|
533
|
+
}, [item?.id, Player]);
|
|
534
|
+
|
|
535
|
+
useEffect(() => {
|
|
519
536
|
if (!isModal) {
|
|
520
537
|
showNavBar(false);
|
|
521
538
|
}
|
|
@@ -525,13 +542,11 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
525
542
|
}
|
|
526
543
|
|
|
527
544
|
return () => {
|
|
528
|
-
playerEvent("player_did_close", { item });
|
|
529
|
-
|
|
530
545
|
if (!isModal) {
|
|
531
546
|
showNavBar(true);
|
|
532
547
|
}
|
|
533
548
|
};
|
|
534
|
-
}, [showNavBar,
|
|
549
|
+
}, [showNavBar, isModal, Player]);
|
|
535
550
|
|
|
536
551
|
useEffect(() => {
|
|
537
552
|
if (prevItemId && !R.equals(prevItemId, item?.id)) {
|
|
@@ -552,10 +567,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
552
567
|
|
|
553
568
|
const uri = item?.content ? item.content?.src : null;
|
|
554
569
|
|
|
555
|
-
const isInlineTV =
|
|
556
|
-
screenData?.ui_components &&
|
|
557
|
-
screenData?.ui_components?.length > 0 &&
|
|
558
|
-
isTV();
|
|
570
|
+
const isInlineTV = isInlineTVUtil(screenData);
|
|
559
571
|
|
|
560
572
|
const inline =
|
|
561
573
|
[VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(mode) ||
|
|
@@ -580,7 +592,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
580
592
|
);
|
|
581
593
|
}
|
|
582
594
|
|
|
583
|
-
if (screen_background_color) {
|
|
595
|
+
if (screen_background_color && mode !== VideoModalMode.FULLSCREEN) {
|
|
584
596
|
updatedStyles.playerScreen.backgroundColor = screen_background_color;
|
|
585
597
|
}
|
|
586
598
|
|
|
@@ -598,6 +610,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
598
610
|
tv_component_container_height,
|
|
599
611
|
screen_background_color,
|
|
600
612
|
isInlineTV,
|
|
613
|
+
mode,
|
|
601
614
|
]);
|
|
602
615
|
|
|
603
616
|
const applePlayerProps = {
|
|
@@ -609,12 +622,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
609
622
|
playNextData,
|
|
610
623
|
};
|
|
611
624
|
|
|
612
|
-
const restPlayerProps = {
|
|
613
|
-
item,
|
|
614
|
-
showAudioPlayer: isAudioContent,
|
|
615
|
-
pluginConfiguration,
|
|
616
|
-
};
|
|
617
|
-
|
|
618
625
|
return (
|
|
619
626
|
<PlayerStateContext.Provider value={value}>
|
|
620
627
|
<PlayerContainerContextProvider
|
|
@@ -625,12 +632,8 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
625
632
|
<PlayerContainerContext.Consumer>
|
|
626
633
|
{(context) => (
|
|
627
634
|
<TVEventHandlerComponent
|
|
628
|
-
tvEventHandler={(
|
|
629
|
-
playerRemoteHandler(
|
|
630
|
-
component,
|
|
631
|
-
event,
|
|
632
|
-
context.isLanguageOverlayVisible
|
|
633
|
-
)
|
|
635
|
+
tvEventHandler={(_component, event) =>
|
|
636
|
+
playerRemoteHandler(event, context.isLanguageOverlayVisible)
|
|
634
637
|
}
|
|
635
638
|
>
|
|
636
639
|
<FocusableGroup
|
|
@@ -646,7 +649,14 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
646
649
|
testID={"player-screen-container"}
|
|
647
650
|
>
|
|
648
651
|
{/* Player container */}
|
|
649
|
-
<View
|
|
652
|
+
<View
|
|
653
|
+
style={[
|
|
654
|
+
styles.playerWrapper,
|
|
655
|
+
// eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
|
|
656
|
+
withBorderHack(),
|
|
657
|
+
]}
|
|
658
|
+
testID={"player-wrapper"}
|
|
659
|
+
>
|
|
650
660
|
<PlayerFocusableWrapperView
|
|
651
661
|
nextFocusDown={context.bottomFocusableId}
|
|
652
662
|
>
|
|
@@ -687,12 +697,10 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
687
697
|
</Player>
|
|
688
698
|
</PlayerFocusableWrapperView>
|
|
689
699
|
|
|
690
|
-
{
|
|
691
|
-
|
|
692
|
-
{state.error && <ErrorDisplay error={state.error} />}
|
|
700
|
+
{state.error ? <ErrorDisplay error={state.error} /> : null}
|
|
693
701
|
</View>
|
|
694
702
|
{/* Components container */}
|
|
695
|
-
{isInlineTV && context.showComponentsContainer
|
|
703
|
+
{isInlineTV && context.showComponentsContainer ? (
|
|
696
704
|
<View
|
|
697
705
|
style={styles.inlineRiver}
|
|
698
706
|
testID={"inline-river-component-wrapper"}
|
|
@@ -712,8 +720,10 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
712
720
|
screenId={screenData.id}
|
|
713
721
|
key={item.id}
|
|
714
722
|
groupId={FocusableGroupMainContainerId}
|
|
715
|
-
cellTapAction={
|
|
716
|
-
extraAnchorPointYOffset={
|
|
723
|
+
cellTapAction={onCellTap}
|
|
724
|
+
extraAnchorPointYOffset={
|
|
725
|
+
EXTRA_ANCHOR_POINT_Y_OFFSET
|
|
726
|
+
}
|
|
717
727
|
isScreenWrappedInContainer={true}
|
|
718
728
|
containerHeight={styles.inlineRiver.height}
|
|
719
729
|
componentsMapExtraProps={{
|
|
@@ -723,7 +733,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
723
733
|
)}
|
|
724
734
|
</ComponentFocusableWrapperView>
|
|
725
735
|
</View>
|
|
726
|
-
)}
|
|
736
|
+
) : null}
|
|
727
737
|
</View>
|
|
728
738
|
</FocusableGroup>
|
|
729
739
|
</TVEventHandlerComponent>
|
|
@@ -9,11 +9,14 @@ type ContextProps = {
|
|
|
9
9
|
setIsLanguageOverlayVisible: (isVisible) => void;
|
|
10
10
|
setShowComponentsContainer: (isVisible) => void;
|
|
11
11
|
showComponentsContainer: boolean;
|
|
12
|
+
setIsSeekBarTouch: (isTouch) => void;
|
|
13
|
+
isSeekBarTouch: boolean;
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
export const PlayerContainerContext = createContext({
|
|
15
17
|
ignoreOffsetContainer: false,
|
|
16
18
|
isLanguageOverlayVisible: false,
|
|
19
|
+
isSeekBarTouch: false,
|
|
17
20
|
} as ContextProps);
|
|
18
21
|
|
|
19
22
|
type Props = {
|
|
@@ -40,6 +43,8 @@ export const PlayerContainerContextProvider = ({
|
|
|
40
43
|
const [showComponentsContainer, setShowComponentsContainer] =
|
|
41
44
|
React.useState(true);
|
|
42
45
|
|
|
46
|
+
const [isSeekBarTouch, setIsSeekBarTouch] = React.useState(false);
|
|
47
|
+
|
|
43
48
|
const value = React.useMemo(
|
|
44
49
|
() => ({
|
|
45
50
|
ignoreOffsetContainer,
|
|
@@ -49,6 +54,8 @@ export const PlayerContainerContextProvider = ({
|
|
|
49
54
|
setIsLanguageOverlayVisible,
|
|
50
55
|
showComponentsContainer,
|
|
51
56
|
setShowComponentsContainer: inline ? setShowComponentsContainer : null,
|
|
57
|
+
isSeekBarTouch,
|
|
58
|
+
setIsSeekBarTouch,
|
|
52
59
|
}),
|
|
53
60
|
[
|
|
54
61
|
ignoreOffsetContainer,
|
|
@@ -58,6 +65,8 @@ export const PlayerContainerContextProvider = ({
|
|
|
58
65
|
setIsLanguageOverlayVisible,
|
|
59
66
|
showComponentsContainer,
|
|
60
67
|
setShowComponentsContainer,
|
|
68
|
+
isSeekBarTouch,
|
|
69
|
+
setIsSeekBarTouch,
|
|
61
70
|
]
|
|
62
71
|
);
|
|
63
72
|
|
|
@@ -114,12 +114,12 @@ function ProgramInfoComponent({
|
|
|
114
114
|
return (
|
|
115
115
|
<View style={container}>
|
|
116
116
|
<View style={programStyles.programInfo.container}>
|
|
117
|
-
{logo
|
|
117
|
+
{logo ? (
|
|
118
118
|
<Image
|
|
119
119
|
source={{ uri: logo }}
|
|
120
120
|
style={programStyles.programInfo.logo}
|
|
121
121
|
/>
|
|
122
|
-
)}
|
|
122
|
+
) : null}
|
|
123
123
|
{!isAudioContent && transportInfo}
|
|
124
124
|
</View>
|
|
125
125
|
</View>
|