@applicaster/zapp-react-native-ui-components 13.0.2 → 13.0.3-rc.0

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.
@@ -7,12 +7,14 @@ import {
7
7
  import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
8
8
  import {
9
9
  useDimensions,
10
+ useIsTablet as isTablet,
10
11
  useNavigation,
11
12
  } from "@applicaster/zapp-react-native-utils/reactHooks";
12
13
 
13
14
  import { BufferAnimation } from "../PlayerContainer/BufferAnimation";
14
15
  import { PlayerContainer } from "../PlayerContainer";
15
16
  import { useModalSize } from "../VideoModal/hooks";
17
+ import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
16
18
 
17
19
  type Props = {
18
20
  item: ZappEntry;
@@ -83,6 +85,13 @@ type PlayableComponent = {
83
85
  Component: React.ComponentType<any>;
84
86
  };
85
87
 
88
+ const dimensionsContext: "window" | "screen" = platformSelect({
89
+ android_tv: "window",
90
+ amazon: "window",
91
+ // eslint-disable-next-line react-hooks/rules-of-hooks
92
+ default: isTablet() ? "window" : "screen", // on tablet, window represents correct values, on phone it's not as the screen could be rotated
93
+ });
94
+
86
95
  export function HandlePlayable({
87
96
  item,
88
97
  isModal,
@@ -135,7 +144,8 @@ export function HandlePlayable({
135
144
  });
136
145
  }, [casting]);
137
146
 
138
- const { width: screenWidth, height: screenHeight } = useDimensions("window");
147
+ const { width: screenWidth, height: screenHeight } =
148
+ useDimensions(dimensionsContext);
139
149
 
140
150
  const modalSize = useModalSize();
141
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.2",
3
+ "version": "13.0.3-rc.0",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -31,10 +31,10 @@
31
31
  "redux-mock-store": "^1.5.3"
32
32
  },
33
33
  "dependencies": {
34
- "@applicaster/applicaster-types": "13.0.2",
35
- "@applicaster/zapp-react-native-bridge": "13.0.2",
36
- "@applicaster/zapp-react-native-redux": "13.0.2",
37
- "@applicaster/zapp-react-native-utils": "13.0.2",
34
+ "@applicaster/applicaster-types": "13.0.3-rc.0",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.3-rc.0",
36
+ "@applicaster/zapp-react-native-redux": "13.0.3-rc.0",
37
+ "@applicaster/zapp-react-native-utils": "13.0.3-rc.0",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",