@applicaster/zapp-react-native-ui-components 16.0.0-rc.23 → 16.0.0-rc.25

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.
@@ -18,10 +18,13 @@ import {
18
18
  useScreenData,
19
19
  } from "@applicaster/zapp-react-native-utils/reactHooks";
20
20
  import { getNavigationPluginModule } from "@applicaster/zapp-react-native-app/App/Layout/layoutHelpers";
21
+ import {
22
+ isValidColor,
23
+ isTransparentColor,
24
+ } from "@applicaster/zapp-react-native-utils/colorUtils";
21
25
 
22
26
  import { RouteManager } from "../RouteManager";
23
27
  import { useScreenConfiguration } from "../River/useScreenConfiguration";
24
- import { isValidColor } from "./utils";
25
28
  import { useWaitForValidOrientation } from "./hooks";
26
29
 
27
30
  const screenStyles = {
@@ -82,11 +85,10 @@ export function Screen(_props: Props) {
82
85
  const style = React.useMemo(
83
86
  () => ({
84
87
  ...screenStyles,
85
- // FIXME: add logic to use backgroundColor if it valid_color and non-transparent, otherwise use theme.app_background_color.
86
- // Current implementation treats "red" color as invalid color.
87
- backgroundColor: isValidColor(backgroundColor)
88
- ? backgroundColor
89
- : theme.app_background_color,
88
+ backgroundColor:
89
+ isValidColor(backgroundColor) && !isTransparentColor(backgroundColor)
90
+ ? backgroundColor
91
+ : theme.app_background_color,
90
92
  }),
91
93
  [theme.app_background_color, backgroundColor]
92
94
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "16.0.0-rc.23",
3
+ "version": "16.0.0-rc.25",
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": "16.0.0-rc.23",
32
- "@applicaster/zapp-react-native-bridge": "16.0.0-rc.23",
33
- "@applicaster/zapp-react-native-redux": "16.0.0-rc.23",
34
- "@applicaster/zapp-react-native-utils": "16.0.0-rc.23",
31
+ "@applicaster/applicaster-types": "16.0.0-rc.25",
32
+ "@applicaster/zapp-react-native-bridge": "16.0.0-rc.25",
33
+ "@applicaster/zapp-react-native-redux": "16.0.0-rc.25",
34
+ "@applicaster/zapp-react-native-utils": "16.0.0-rc.25",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",
@@ -1,16 +0,0 @@
1
- import { map, split, replace, compose, trim } from "ramda";
2
-
3
- function colorIsNotTransparent(color) {
4
- const layers = compose(
5
- map(trim),
6
- split(","),
7
- replace(")", ""),
8
- replace("rgba(", "")
9
- )(color);
10
-
11
- return Number(layers?.[3]) > 0;
12
- }
13
-
14
- export function isValidColor(string) {
15
- return string && string !== "transparent" && colorIsNotTransparent(string);
16
- }