@applicaster/zapp-react-native-ui-components 12.0.0-alpha.7243491200 → 12.0.0-alpha.7254207052

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.
@@ -1,19 +1,29 @@
1
+ import FastImage, { Source } from "@applicaster/react-native-fast-image";
1
2
  import { useMemo } from "react";
3
+ import { ImageRequireSource } from "react-native";
2
4
 
3
- export const useImageSource = (source) => {
5
+ function getSourceCache(cache: Source["cache"]) {
6
+ return cache || FastImage.cacheControl.web;
7
+ }
8
+
9
+ export const useImageSource = (source?: Source | ImageRequireSource) => {
4
10
  return useMemo(() => {
5
- if (typeof source === "number") {
6
- return source;
11
+ if (source) {
12
+ if (typeof source === "number") {
13
+ return source;
14
+ }
15
+
16
+ return {
17
+ uri: source.uri,
18
+ headers: source.headers,
19
+ priority: source.priority,
20
+ cache: getSourceCache(source?.cache),
21
+ maxWidth: source.maxWidth,
22
+ maxHeight: source.maxHeight,
23
+ };
7
24
  }
8
25
 
9
- return {
10
- uri: source.uri,
11
- headers: source.headers,
12
- priority: source.priority,
13
- cache: source.cache,
14
- maxWidth: source.maxWidth,
15
- maxHeight: source.maxHeight,
16
- };
26
+ return undefined;
17
27
  }, [
18
28
  ...(typeof source === "object"
19
29
  ? [
@@ -145,13 +145,7 @@ const renderApplePlayer = ({
145
145
  }) => {
146
146
  const { title, summary } = item || {};
147
147
 
148
- if (!isApplePlatform() || !player) {
149
- return null;
150
- }
151
-
152
- // TODO: Check if it is not breaking default player logic on tvos
153
- // Also if needs to add on tvos brightcove player for QB player
154
- if (player.supportsNativeControls()) {
148
+ if (!isAppleTV() || !player) {
155
149
  return null;
156
150
  }
157
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "12.0.0-alpha.7243491200",
3
+ "version": "12.0.0-alpha.7254207052",
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",
@@ -34,10 +34,10 @@
34
34
  "redux-mock-store": "^1.5.3"
35
35
  },
36
36
  "dependencies": {
37
- "@applicaster/applicaster-types": "12.0.0-alpha.7243491200",
38
- "@applicaster/zapp-react-native-bridge": "12.0.0-alpha.7243491200",
39
- "@applicaster/zapp-react-native-redux": "12.0.0-alpha.7243491200",
40
- "@applicaster/zapp-react-native-utils": "12.0.0-alpha.7243491200",
37
+ "@applicaster/applicaster-types": "12.0.0-alpha.7254207052",
38
+ "@applicaster/zapp-react-native-bridge": "12.0.0-alpha.7254207052",
39
+ "@applicaster/zapp-react-native-redux": "12.0.0-alpha.7254207052",
40
+ "@applicaster/zapp-react-native-utils": "12.0.0-alpha.7254207052",
41
41
  "promise": "^8.3.0",
42
42
  "react-router-native": "^5.1.2",
43
43
  "url": "^0.11.0",