@applicaster/zapp-react-native-ui-components 12.0.20-rc.1 → 12.0.20
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.
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Layout TV renders 1`] = `
|
|
4
4
|
<View
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
preferredFocus={true}
|
|
5
|
+
backgroundColor="blue"
|
|
6
|
+
testID="background-component"
|
|
8
7
|
>
|
|
9
8
|
<View
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
excludeFromFocusSearching={true}
|
|
10
|
+
id="/river/A1234"
|
|
11
|
+
preferredFocus={true}
|
|
12
|
+
>
|
|
13
|
+
<View
|
|
14
|
+
Components={
|
|
15
|
+
Object {
|
|
16
|
+
"Background": [Function],
|
|
17
|
+
"NavBar": [Function],
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
route="/river/A1234"
|
|
21
|
+
/>
|
|
22
|
+
</View>
|
|
18
23
|
</View>
|
|
19
24
|
`;
|
|
@@ -6,6 +6,12 @@ import { Provider } from "react-redux";
|
|
|
6
6
|
import { NavigationContext } from "@applicaster/zapp-react-native-ui-components/Contexts/NavigationContext";
|
|
7
7
|
import configureStore from "redux-mock-store";
|
|
8
8
|
|
|
9
|
+
jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
|
|
10
|
+
useTheme: jest.fn(() => ({
|
|
11
|
+
app_background_color: "blue",
|
|
12
|
+
})),
|
|
13
|
+
}));
|
|
14
|
+
|
|
9
15
|
const withoutChildren = omit(["children"]);
|
|
10
16
|
|
|
11
17
|
jest.mock("../../../Screen/TV/index.web", () => ({
|
|
@@ -5,6 +5,8 @@ import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
|
5
5
|
|
|
6
6
|
import { ScreenLayoutContextProvider } from "./ScreenLayoutContextProvider";
|
|
7
7
|
import { StackNavigator } from "../../Navigator";
|
|
8
|
+
import { getBackgroundImageUrl } from "../utils";
|
|
9
|
+
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
8
10
|
|
|
9
11
|
type Components = {
|
|
10
12
|
NavBar: React.ComponentType<any>;
|
|
@@ -16,16 +18,34 @@ type Props = {
|
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const Layout = ({ Components }: Props) => {
|
|
19
|
-
const { appState } = usePickFromState([
|
|
21
|
+
const { appState, remoteConfigurations } = usePickFromState([
|
|
22
|
+
"appState",
|
|
23
|
+
"remoteConfigurations",
|
|
24
|
+
]);
|
|
25
|
+
|
|
20
26
|
const appReady = pathOr(false, ["appReady"], appState);
|
|
21
27
|
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
|
|
30
|
+
const backgroundColor = React.useMemo(() => theme.app_background_color, []);
|
|
31
|
+
|
|
32
|
+
const backgroundImageUrl = React.useMemo(
|
|
33
|
+
() => getBackgroundImageUrl(remoteConfigurations),
|
|
34
|
+
[remoteConfigurations]
|
|
35
|
+
);
|
|
36
|
+
|
|
22
37
|
if (!appReady) {
|
|
23
38
|
return null;
|
|
24
39
|
}
|
|
25
40
|
|
|
26
41
|
return (
|
|
27
42
|
<ScreenLayoutContextProvider>
|
|
28
|
-
<
|
|
43
|
+
<Components.Background
|
|
44
|
+
backgroundColor={backgroundColor}
|
|
45
|
+
backgroundImageUrl={backgroundImageUrl}
|
|
46
|
+
>
|
|
47
|
+
<StackNavigator Components={Components} />
|
|
48
|
+
</Components.Background>
|
|
29
49
|
</ScreenLayoutContextProvider>
|
|
30
50
|
);
|
|
31
51
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.20
|
|
3
|
+
"version": "12.0.20",
|
|
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.20
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "12.0.20
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "12.0.20
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "12.0.20
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.20",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.20",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.20",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.20",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|