@applicaster/zapp-react-native-ui-components 14.0.0-alpha.3552323332 → 14.0.0-alpha.3881160800

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.
Files changed (56) hide show
  1. package/Components/AnimatedInOut/index.tsx +5 -3
  2. package/Components/AudioPlayer/index.tsx +15 -0
  3. package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
  4. package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -8
  5. package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
  6. package/Components/AudioPlayer/mobile/index.tsx +18 -0
  7. package/Components/AudioPlayer/{AudioPlayerLayout.tsx → tv/Layout.tsx} +31 -72
  8. package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +170 -0
  9. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
  10. package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +1 -2
  11. package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +12 -59
  12. package/Components/AudioPlayer/types.ts +40 -0
  13. package/Components/Focusable/FocusableTvOS.tsx +3 -3
  14. package/Components/HandlePlayable/HandlePlayable.tsx +14 -8
  15. package/Components/MasterCell/elementMapper.tsx +1 -2
  16. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
  17. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
  18. package/Components/PlayerContainer/PlayerContainer.tsx +8 -18
  19. package/Components/PlayerImageBackground/index.tsx +1 -1
  20. package/Components/River/ComponentsMap/ComponentsMap.tsx +0 -1
  21. package/Components/River/TV/withTVEventHandler.tsx +1 -1
  22. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
  23. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
  24. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
  25. package/Components/VideoLive/animationUtils.ts +3 -3
  26. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +1 -9
  27. package/Components/VideoModal/PlayerDetails.tsx +2 -24
  28. package/Components/VideoModal/PlayerWrapper.tsx +142 -26
  29. package/Components/VideoModal/VideoModal.tsx +17 -3
  30. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +7 -1
  31. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +240 -44
  32. package/Components/VideoModal/hooks/index.ts +2 -0
  33. package/Components/VideoModal/hooks/useBackgroundColor.ts +10 -0
  34. package/Components/VideoModal/utils.ts +0 -6
  35. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
  36. package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
  37. package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
  38. package/package.json +5 -6
  39. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -72
  40. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
  41. package/Components/AudioPlayer/index.ts +0 -1
  42. /package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +0 -0
  43. /package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +0 -0
  44. /package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +0 -0
  45. /package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +0 -0
  46. /package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +0 -0
  47. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
  48. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +0 -0
  49. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
  50. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/channel.test.js.snap +0 -0
  51. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +0 -0
  52. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +0 -0
  53. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
  54. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
  55. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
  56. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
@@ -0,0 +1,40 @@
1
+ import { ViewStyle } from "react-native";
2
+
3
+ export type Props = {
4
+ audio_item: ZappEntry & {
5
+ extensions?: {
6
+ audio_player_artwork_aspect_ratio?: string;
7
+ audio_player_background_image?: string;
8
+ audio_player_background_color?: string;
9
+ audio_player_channel_icon?: string;
10
+ audio_player_title_color?: string;
11
+ audio_player_summary_color?: string;
12
+ audio_player_rtl?: boolean;
13
+ audio_player_background_image_default_color?: string;
14
+ start_time?: string;
15
+ end_time?: string;
16
+ };
17
+ };
18
+ plugin_configuration: {
19
+ audio_player_background_color?: string;
20
+ audio_player_title_color?: string;
21
+ audio_player_summary_color?: string;
22
+ audio_player_rtl?: string;
23
+ audio_player_background_image_default_color?: string;
24
+ audio_player_background_image?: string;
25
+ audio_player_artwork_aspect_ratio?: string;
26
+ lg_tv_audio_player_title_font_family?: string;
27
+ lg_tv_audio_player_title_font_size?: number;
28
+ lg_tv_audio_player_summary_font_family?: string;
29
+ lg_tv_audio_player_summary_font_size?: number;
30
+ samsung_tv_audio_player_title_font_family?: string;
31
+ samsung_tv_audio_player_title_font_size?: number;
32
+ samsung_tv_audio_player_summary_font_family?: string;
33
+ samsung_tv_audio_player_summary_font_size?: number;
34
+ tv_os_audio_player_title_font_family?: string;
35
+ tv_os_audio_player_title_font_size?: number;
36
+ tv_os_audio_player_summary_font_family?: string;
37
+ tv_os_audio_player_summary_font_size?: number;
38
+ };
39
+ style?: ViewStyle;
40
+ };
@@ -16,9 +16,9 @@ function noop() {}
16
16
  type Props = {
17
17
  id: string;
18
18
  groupId: string;
19
- onPress?: (nativeEvent: React.SyntheticEvent) => void;
20
- onFocus?: (nativeEvent: React.SyntheticEvent) => void;
21
- onBlur?: (nativeEvent: React.SyntheticEvent) => void;
19
+ onPress?: (nativeEvent: any) => void;
20
+ onFocus?: (nativeEvent: any) => void;
21
+ onBlur?: (nativeEvent: any) => void;
22
22
  children: (focused?: boolean) => React.ReactNode;
23
23
  isParallaxDisabled: boolean;
24
24
  preferredFocus?: boolean;
@@ -13,6 +13,7 @@ import {
13
13
  import { BufferAnimation } from "../PlayerContainer/BufferAnimation";
14
14
  import { PlayerContainer } from "../PlayerContainer";
15
15
  import { useModalSize } from "../VideoModal/hooks";
16
+ import { ViewStyle } from "react-native";
16
17
 
17
18
  type Props = {
18
19
  item: ZappEntry;
@@ -140,14 +141,19 @@ export function HandlePlayable({
140
141
  const modalSize = useModalSize();
141
142
 
142
143
  const style = React.useMemo(
143
- () => ({
144
- width: isModal ? modalSize.width : mode === "PIP" ? "100%" : screenWidth,
145
- height: isModal
146
- ? modalSize.height
147
- : mode === "PIP"
148
- ? "100%"
149
- : screenHeight,
150
- }),
144
+ () =>
145
+ ({
146
+ width: isModal
147
+ ? modalSize.width
148
+ : mode === "PIP"
149
+ ? "100%"
150
+ : screenWidth,
151
+ height: isModal
152
+ ? modalSize.height
153
+ : mode === "PIP"
154
+ ? "100%"
155
+ : screenHeight,
156
+ }) as ViewStyle,
151
157
  [screenWidth, screenHeight, modalSize, isModal, mode]
152
158
  );
153
159
 
@@ -73,7 +73,6 @@ export function elementMapper(
73
73
  : {};
74
74
 
75
75
  const componentProps = {
76
- key,
77
76
  style,
78
77
  skipButtons: otherProps?.skipButtons,
79
78
  emitAsyncElementRegistrate: otherProps?.emitAsyncElementRegistrate,
@@ -91,7 +90,7 @@ export function elementMapper(
91
90
  const fn = mapElementWithKey(elementMapper(components, otherProps));
92
91
 
93
92
  return (
94
- <Component {...componentProps}>
93
+ <Component key={key} {...componentProps}>
95
94
  {focusableTypes.has(type) && elements.length > 0
96
95
  ? elements.map(fn)
97
96
  : null}
@@ -1,9 +1,12 @@
1
1
  import React from "react";
2
2
  import { Text, Animated } from "react-native";
3
+ import { render } from "@testing-library/react-native";
3
4
 
4
- import renderer from "react-test-renderer";
5
-
6
- jest.useFakeTimers();
5
+ import {
6
+ NotificationView,
7
+ onlinePhrase,
8
+ offlinePhrase,
9
+ } from "../NotificationView";
7
10
 
8
11
  jest.mock("@applicaster/zapp-react-native-redux/hooks", () => ({
9
12
  usePickFromState: () => ({
@@ -32,39 +35,31 @@ jest.mock("react-native-safe-area-context", () => ({
32
35
 
33
36
  const dismiss = jest.fn();
34
37
 
35
- const {
36
- NotificationView,
37
- onlinePhrase,
38
- offlinePhrase,
39
- } = require("../NotificationView");
40
-
41
38
  describe("NotificationView", () => {
42
39
  it("Show online message when Online", () => {
43
- const component = renderer.create(
44
- <NotificationView online dismiss={dismiss} />
45
- );
40
+ const component = render(<NotificationView online dismiss={dismiss} />);
46
41
 
47
- expect(component.root.findByType(Text).props.children).toBe(onlinePhrase);
42
+ expect(component.UNSAFE_getByType(Text).props.children).toBe(onlinePhrase);
48
43
  });
49
44
 
50
45
  it("Show offline message when Online", () => {
51
- const component = renderer.create(
46
+ const component = render(
52
47
  <NotificationView online={false} dismiss={dismiss} />
53
48
  );
54
49
 
55
- expect(component.root.findByType(Text).props.children).toBe(offlinePhrase);
50
+ expect(component.UNSAFE_getByType(Text).props.children).toBe(offlinePhrase);
56
51
  });
57
52
 
58
53
  it("When hidden is false to true notification is visible", () => {
59
- const component = renderer.create(
54
+ const component = render(
60
55
  <NotificationView online={false} hidden={false} dismiss={dismiss} />
61
56
  );
62
57
 
63
- component.update(
58
+ component.rerender(
64
59
  <NotificationView online={false} hidden={true} dismiss={dismiss} />
65
60
  );
66
61
 
67
- const animatedView = component.root.findByType(Animated.View);
62
+ const animatedView = component.UNSAFE_getByType(Animated.View);
68
63
  const animatedViewStyles = animatedView.props.style;
69
64
 
70
65
  expect(animatedViewStyles.opacity).toBe(1);
@@ -21,6 +21,15 @@ exports[`OfflineHandler renders 1`] = `
21
21
  }
22
22
  >
23
23
  <View
24
+ accessibilityState={
25
+ {
26
+ "busy": undefined,
27
+ "checked": undefined,
28
+ "disabled": undefined,
29
+ "expanded": undefined,
30
+ "selected": undefined,
31
+ }
32
+ }
24
33
  accessible={true}
25
34
  collapsable={false}
26
35
  focusable={true}
@@ -88,7 +88,7 @@ export const VideoModalMode = {
88
88
  MAXIMIZED: "MAXIMIZED",
89
89
  MINIMIZED: "MINIMIZED",
90
90
  FULLSCREEN: "FULLSCREEN",
91
- } as const;
91
+ };
92
92
 
93
93
  export type PlayNextData = {
94
94
  state: PlayNextState;
@@ -127,7 +127,7 @@ const webStyles = {
127
127
  playerScreen: {
128
128
  flex: 1,
129
129
  height: "100vh",
130
- backgroundColor: "black",
130
+ background: "black",
131
131
  },
132
132
  playerWrapper: {
133
133
  height: "100%",
@@ -135,9 +135,6 @@ const webStyles = {
135
135
  },
136
136
  inlineRiver: {
137
137
  height: INLINE_CONTAINER_CONTENT_HEIGHT,
138
-
139
- borderWidth: 4,
140
- borderColor: "yellow",
141
138
  },
142
139
  };
143
140
 
@@ -148,6 +145,7 @@ const nativeStyles = {
148
145
  },
149
146
  playerScreen: {
150
147
  flex: 1,
148
+ backgroundColor: "black",
151
149
  overflow: "hidden",
152
150
  },
153
151
  playerWrapper: {
@@ -567,9 +565,8 @@ const PlayerContainerComponent = (props: Props) => {
567
565
  const isInlineTV = isInlineTVUtil(screenData);
568
566
 
569
567
  const inline =
570
- [VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(
571
- mode as any
572
- ) || isInlineTV;
568
+ [VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(mode) ||
569
+ isInlineTV;
573
570
 
574
571
  const value = React.useMemo(
575
572
  () => ({ playerId: state.playerId }),
@@ -590,11 +587,7 @@ const PlayerContainerComponent = (props: Props) => {
590
587
  );
591
588
  }
592
589
 
593
- if (
594
- screen_background_color &&
595
- mode !== VideoModalMode.FULLSCREEN &&
596
- isTV()
597
- ) {
590
+ if (screen_background_color && mode !== VideoModalMode.FULLSCREEN) {
598
591
  updatedStyles.playerScreen.backgroundColor = screen_background_color;
599
592
  }
600
593
 
@@ -634,7 +627,7 @@ const PlayerContainerComponent = (props: Props) => {
634
627
  <PlayerContainerContext.Consumer>
635
628
  {(context) => (
636
629
  <TVEventHandlerComponent
637
- tvEventHandler={(_component, event) =>
630
+ tvEventHandler={(event) =>
638
631
  playerRemoteHandler(event, context.isLanguageOverlayVisible)
639
632
  }
640
633
  >
@@ -644,17 +637,14 @@ const PlayerContainerComponent = (props: Props) => {
644
637
  preferredFocus
645
638
  shouldUsePreferredFocus
646
639
  groupId={groupId}
647
- pointerEvents={mode === "MINIMIZED" ? "box-none" : "auto"}
648
640
  >
649
641
  {/* Video player and components */}
650
642
  <View
651
643
  style={styles.playerScreen}
652
644
  testID={"player-screen-container"}
653
- pointerEvents={mode === "MINIMIZED" ? "box-none" : "auto"}
654
645
  >
655
646
  {/* Player container */}
656
647
  <View
657
- pointerEvents={mode === "MINIMIZED" ? "box-none" : "auto"}
658
648
  style={[
659
649
  styles.playerWrapper,
660
650
  // eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
@@ -726,7 +716,7 @@ const PlayerContainerComponent = (props: Props) => {
726
716
  key={item.id}
727
717
  groupId={FocusableGroupMainContainerId}
728
718
  cellTapAction={onCellTap}
729
- extraAnchorPointYOffset={-600}
719
+ extraAnchorPointYOffset={0}
730
720
  isScreenWrappedInContainer={true}
731
721
  containerHeight={styles.inlineRiver.height}
732
722
  componentsMapExtraProps={{
@@ -28,7 +28,7 @@ const PlayerImageBackgroundComponent = ({
28
28
  defaultImageDimensions,
29
29
  }: Props) => {
30
30
  const source = React.useMemo(
31
- () => ({ uri: imageSrcFromMediaItem(entry, imageKey) }),
31
+ () => ({ uri: imageSrcFromMediaItem(entry, [imageKey]) }),
32
32
  [imageKey, entry]
33
33
  );
34
34
 
@@ -286,7 +286,6 @@ function ComponentsMapComponent(props: Props) {
286
286
  initialNumToRender={3}
287
287
  maxToRenderPerBatch={10}
288
288
  windowSize={12}
289
- listKey={riverId}
290
289
  keyExtractor={keyExtractor}
291
290
  renderItem={renderRiverItem}
292
291
  data={riverComponents}
@@ -8,7 +8,7 @@ export const withTvEventHandler = (Component) => {
8
8
  return function WithTVEventHandler(props) {
9
9
  const navigator = useNavigation();
10
10
 
11
- const remoteHandler = (_, event) => {
11
+ const remoteHandler = (event) => {
12
12
  const { eventType } = event;
13
13
 
14
14
  const canGoBack = navigator.canGoBack();
@@ -159,6 +159,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
159
159
  >
160
160
  <View>
161
161
  <View
162
+ onFocusCapture={[Function]}
162
163
  onLayout={[Function]}
163
164
  style={null}
164
165
  >
@@ -174,6 +175,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
174
175
  </View>
175
176
  </View>
176
177
  <View
178
+ onFocusCapture={[Function]}
177
179
  onLayout={[Function]}
178
180
  style={null}
179
181
  >
@@ -3,6 +3,23 @@
3
3
  exports[`<Touchable /> when not running in automated tests environment renders correctly 1`] = `
4
4
  <View
5
5
  accessibilityLabel="some-test-id"
6
+ accessibilityState={
7
+ {
8
+ "busy": undefined,
9
+ "checked": undefined,
10
+ "disabled": undefined,
11
+ "expanded": undefined,
12
+ "selected": undefined,
13
+ }
14
+ }
15
+ accessibilityValue={
16
+ {
17
+ "max": undefined,
18
+ "min": undefined,
19
+ "now": undefined,
20
+ "text": undefined,
21
+ }
22
+ }
6
23
  accessible={true}
7
24
  collapsable={false}
8
25
  focusable={true}
@@ -29,6 +46,23 @@ exports[`<Touchable /> when not running in automated tests environment renders c
29
46
  exports[`<Touchable /> when running in automated tests environment has accessible flag set to false 1`] = `
30
47
  <View
31
48
  accessibilityLabel="some-test-id"
49
+ accessibilityState={
50
+ {
51
+ "busy": undefined,
52
+ "checked": undefined,
53
+ "disabled": undefined,
54
+ "expanded": undefined,
55
+ "selected": undefined,
56
+ }
57
+ }
58
+ accessibilityValue={
59
+ {
60
+ "max": undefined,
61
+ "min": undefined,
62
+ "now": undefined,
63
+ "text": undefined,
64
+ }
65
+ }
32
66
  accessible={false}
33
67
  collapsable={false}
34
68
  focusable={true}
@@ -6,15 +6,21 @@ exports[`<Scene /> renders correctly 1`] = `
6
6
  collapsable={false}
7
7
  pointerEvents="auto"
8
8
  style={
9
- {
10
- "flex": 1,
11
- "fontScale": 2,
12
- "height": 1334,
13
- "paddingBottom": 49,
14
- "scale": 2,
15
- "statusBarHeight": null,
16
- "width": 750,
17
- }
9
+ [
10
+ {
11
+ "flex": 1,
12
+ },
13
+ {
14
+ "paddingBottom": 49,
15
+ },
16
+ {
17
+ "fontScale": 2,
18
+ "height": 1334,
19
+ "scale": 2,
20
+ "statusBarHeight": null,
21
+ "width": 750,
22
+ },
23
+ ]
18
24
  }
19
25
  />
20
26
  </View>
@@ -1,8 +1,8 @@
1
1
  import { Animated, Easing, EasingFunction, StyleProp } from "react-native";
2
2
 
3
3
  type AnimatedInterpolatedStyle =
4
- | Animated.AnimatedInterpolation
5
- | [{ [Key: string]: Animated.AnimatedInterpolation }];
4
+ | Animated.AnimatedInterpolation<number>
5
+ | [{ [Key: string]: Animated.AnimatedInterpolation<number> }];
6
6
 
7
7
  type AnimationConfig = {
8
8
  duration: number;
@@ -31,7 +31,7 @@ const interpolate = (
31
31
  animatedValue: Animated.Value,
32
32
  from: number = 0,
33
33
  to: number = 1
34
- ): Animated.AnimatedInterpolation =>
34
+ ): Animated.AnimatedInterpolation<number> =>
35
35
  animatedValue.interpolate({
36
36
  inputRange: [0, 1],
37
37
  outputRange: [from, to],
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from "react";
2
- import { Animated, Dimensions } from "react-native";
2
+ import { Animated } from "react-native";
3
3
 
4
4
  import {
5
5
  useSafeAreaInsets,
@@ -23,7 +23,6 @@ export enum PlayerAnimationStateEnum {
23
23
  export type PlayerAnimationStateT = number | PlayerAnimationStateEnum | null;
24
24
 
25
25
  export type ModalAnimationContextT = {
26
- yTranslate: React.MutableRefObject<Animated.Value | null>;
27
26
  isActiveGesture: boolean;
28
27
  playerAnimationState: PlayerAnimationStateT;
29
28
  setPlayerAnimationState: (value: PlayerAnimationStateT) => void;
@@ -49,7 +48,6 @@ export type ModalAnimationContextT = {
49
48
  };
50
49
 
51
50
  export const ReactContext = React.createContext<ModalAnimationContextT>({
52
- yTranslate: React.createRef<Animated.Value | null>(),
53
51
  isActiveGesture: false,
54
52
  playerAnimationState: null,
55
53
  setPlayerAnimationState: () => null,
@@ -75,10 +73,6 @@ export const ReactContext = React.createContext<ModalAnimationContextT>({
75
73
  });
76
74
 
77
75
  const Provider = ({ children }: { children: React.ReactNode }) => {
78
- const yTranslate = React.useRef(
79
- new Animated.Value(Dimensions.get("window").height)
80
- );
81
-
82
76
  const [playerAnimationState, setPlayerAnimationState] =
83
77
  React.useState<PlayerAnimationStateT>(null);
84
78
 
@@ -106,7 +100,6 @@ const Provider = ({ children }: { children: React.ReactNode }) => {
106
100
  // Reset player animation state when video modal is closed
107
101
  if (!visible) {
108
102
  resetPlayerAnimationState();
109
- yTranslate.current?.setValue(Dimensions.get("window").height);
110
103
  }
111
104
  }, [visible, resetPlayerAnimationState]);
112
105
 
@@ -148,7 +141,6 @@ const Provider = ({ children }: { children: React.ReactNode }) => {
148
141
  return (
149
142
  <ReactContext.Provider
150
143
  value={{
151
- yTranslate,
152
144
  startComponentsAnimation,
153
145
  setStartComponentsAnimation,
154
146
  isActiveGesture: playerAnimationState !== null,
@@ -11,8 +11,6 @@ import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactH
11
11
  import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
12
12
  import { useSafeAreaInsets } from "react-native-safe-area-context";
13
13
  import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
14
- import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
15
- import { useDelayedPlayerDetails } from "./hooks";
16
14
 
17
15
  const { width: SCREEN_WIDTH } = Dimensions.get("screen");
18
16
 
@@ -28,10 +26,6 @@ type Props = {
28
26
  isTabletLandscape?: boolean;
29
27
  isAudioPlayer?: boolean;
30
28
  isTablet?: boolean;
31
- inline?: any;
32
- docked?: boolean;
33
- isModal?: boolean;
34
- pip?: boolean;
35
29
  };
36
30
 
37
31
  const containerStyle = ({
@@ -48,24 +42,8 @@ export const PlayerDetails = ({
48
42
  configuration,
49
43
  isTabletLandscape = false,
50
44
  isAudioPlayer,
51
- inline,
52
- docked,
53
- isModal,
54
- pip,
45
+ isTablet = false,
55
46
  }: Props) => {
56
- const isInlineModal = inline && isModal;
57
-
58
- // Mounting the PlayerDetails component is a resource-intensive process.
59
- // Therefore, for performance reasons, we mount it with a delay to make the rotation process as smooth as possible.
60
- // The flow is as follows: the rotation occurs first, and then, after a short delay, we mount the PlayerDetails component.
61
- // This helps to avoid blocking the rotation and any animations related to the rotation.
62
- const isShowPlayerDetails = useDelayedPlayerDetails({
63
- isInline: isInlineModal,
64
- isDocked: docked,
65
- isPip: pip,
66
- });
67
-
68
- const isTablet = useIsTablet();
69
47
  const screenData = useTargetScreenData(entry);
70
48
  const insets = useSafeAreaInsets();
71
49
 
@@ -101,7 +79,7 @@ export const PlayerDetails = ({
101
79
  }
102
80
  }, [isAudioPlayer]);
103
81
 
104
- if (isNilOrEmpty(screenData?.ui_components) || !isShowPlayerDetails) {
82
+ if (isNilOrEmpty(screenData?.ui_components)) {
105
83
  return null;
106
84
  }
107
85