@applicaster/zapp-react-native-ui-components 15.0.0-alpha.1228610025 → 15.0.0-alpha.1232030550

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.
@@ -0,0 +1,57 @@
1
+ import * as React from "react";
2
+ import * as R from "ramda";
3
+ import { Text, TextStyle, View, ViewStyle } from "react-native";
4
+
5
+ import { getLocalizations } from "@applicaster/zapp-react-native-utils/localizationUtils";
6
+ import { getAppStylesColor } from "@applicaster/zapp-react-native-utils/stylesUtils";
7
+ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
8
+ import { styleKeys } from "@applicaster/zapp-react-native-utils/styleKeysUtils";
9
+
10
+ type Props = {
11
+ styles: {};
12
+ error: {};
13
+ remoteConfigurations: { localizations: {} };
14
+ };
15
+
16
+ const defaultAppStyles = {
17
+ loading_error_label: {
18
+ color: "#aaa",
19
+ },
20
+ };
21
+
22
+ const textStyles = (appStyles = defaultAppStyles): TextStyle => ({
23
+ color: getAppStylesColor("loading_error_label", appStyles),
24
+ fontSize: 36,
25
+ textAlign: "center",
26
+ });
27
+
28
+ const errorStyles = ({ backgroundColor }): ViewStyle => ({
29
+ flex: 1,
30
+ width: "100%",
31
+ height: "100%",
32
+ justifyContent: "center",
33
+ alignItems: "center",
34
+ position: "absolute",
35
+ zIndex: 100,
36
+ backgroundColor,
37
+ });
38
+
39
+ export function ErrorDisplayComponent({
40
+ styles,
41
+ remoteConfigurations: { localizations },
42
+ }: Props) {
43
+ const theme = useTheme();
44
+ const backgroundColor = theme?.app_background_color;
45
+
46
+ const { stream_error_message = "Cannot play stream" } = getLocalizations({
47
+ localizations,
48
+ });
49
+
50
+ const appStyles = R.prop(styleKeys.style_namespace, styles);
51
+
52
+ return (
53
+ <View style={errorStyles({ backgroundColor })}>
54
+ <Text style={textStyles(appStyles)}>{stream_error_message}</Text>
55
+ </View>
56
+ );
57
+ }
@@ -0,0 +1,9 @@
1
+ import * as R from "ramda";
2
+
3
+ import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
4
+
5
+ import { ErrorDisplayComponent } from "./ErrorDisplay";
6
+
7
+ export const ErrorDisplay = R.compose(
8
+ connectToStore(R.pick(["remoteConfigurations"]))
9
+ )(ErrorDisplayComponent);
@@ -46,6 +46,7 @@ import {
46
46
  PlayerContainerContextProvider,
47
47
  } from "./PlayerContainerContext";
48
48
  import { FocusableGroup } from "@applicaster/zapp-react-native-ui-components/Components/FocusableGroup";
49
+ import { ErrorDisplay } from "./ErrorDisplay";
49
50
  import { PlayerFocusableWrapperView } from "./WappersView/PlayerFocusableWrapperView";
50
51
  import { FocusableGroupMainContainerId } from "./index";
51
52
  import { isPlayable } from "@applicaster/zapp-react-native-utils/navigationUtils/itemTypeMatchers";
@@ -338,6 +339,12 @@ const PlayerContainerComponent = (props: Props) => {
338
339
  playerContainerLogger.error(errorObj);
339
340
 
340
341
  setState({ error: errorObj });
342
+
343
+ if (!isTvOS) {
344
+ setTimeout(() => {
345
+ close();
346
+ }, 800);
347
+ }
341
348
  },
342
349
  [close]
343
350
  );
@@ -688,6 +695,8 @@ const PlayerContainerComponent = (props: Props) => {
688
695
  </Player>
689
696
  )}
690
697
  </PlayerFocusableWrapperView>
698
+
699
+ {state.error ? <ErrorDisplay error={state.error} /> : null}
691
700
  </View>
692
701
  {/* Components container */}
693
702
  {isInlineTV && context.showComponentsContainer ? (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "15.0.0-alpha.1228610025",
3
+ "version": "15.0.0-alpha.1232030550",
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",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "15.0.0-alpha.1228610025",
32
- "@applicaster/zapp-react-native-bridge": "15.0.0-alpha.1228610025",
33
- "@applicaster/zapp-react-native-redux": "15.0.0-alpha.1228610025",
34
- "@applicaster/zapp-react-native-utils": "15.0.0-alpha.1228610025",
31
+ "@applicaster/applicaster-types": "15.0.0-alpha.1232030550",
32
+ "@applicaster/zapp-react-native-bridge": "15.0.0-alpha.1232030550",
33
+ "@applicaster/zapp-react-native-redux": "15.0.0-alpha.1232030550",
34
+ "@applicaster/zapp-react-native-utils": "15.0.0-alpha.1232030550",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",