@applicaster/zapp-react-native-app 15.1.0-rc.1 → 16.0.0-alpha.9803580571

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.
@@ -57,7 +57,17 @@ exports[`Layout should match snapshot when appReady is true 1`] = `
57
57
  },
58
58
  "currentRoute": "home",
59
59
  "data": {},
60
- "isVideoModalDocked": false,
60
+ "isVideoModalDocked": [MockFunction] {
61
+ "calls": [
62
+ [],
63
+ ],
64
+ "results": [
65
+ {
66
+ "type": "return",
67
+ "value": false,
68
+ },
69
+ ],
70
+ },
61
71
  "videoModalState": {
62
72
  "mode": "MINIMIZED",
63
73
  "visible": false,
@@ -59,7 +59,13 @@ jest.mock(
59
59
  })
60
60
  );
61
61
 
62
- const mockUseNavigation = jest.fn();
62
+ const mockUseNavigation = jest.fn(() => ({
63
+ activeRiver: { navigations: [] },
64
+ videoModalState: { visible: false, mode: "MINIMIZED" },
65
+ currentRoute: "home",
66
+ data: {},
67
+ isVideoModalDocked: jest.fn(() => false),
68
+ }));
63
69
 
64
70
  jest.mock(
65
71
  "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation",
@@ -160,28 +166,6 @@ jest.mock("@applicaster/zapp-react-native-utils/navigationUtils", () => ({
160
166
  const { Layout } = require("../");
161
167
 
162
168
  describe("Layout", () => {
163
- beforeAll(() => {
164
- mockUseNavigation.mockImplementation(() => ({
165
- activeRiver: { navigations: [] },
166
- videoModalState: { visible: false, mode: "MINIMIZED" },
167
- isVideoModalDocked: false,
168
- currentRoute: "home",
169
- data: {},
170
- }));
171
- });
172
-
173
- beforeEach(() => {
174
- jest.clearAllMocks();
175
-
176
- mockUseNavigation.mockImplementation(() => ({
177
- activeRiver: { navigations: [] },
178
- videoModalState: { visible: false, mode: "MINIMIZED" },
179
- isVideoModalDocked: false,
180
- currentRoute: "home",
181
- data: {},
182
- }));
183
- });
184
-
185
169
  it("should match snapshot when appReady is true", () => {
186
170
  const { toJSON } = renderWithProviders(<Layout />);
187
171
 
@@ -208,7 +192,7 @@ describe("Layout", () => {
208
192
  mockUseNavigation.mockReturnValue({
209
193
  activeRiver: { navigations: [] },
210
194
  videoModalState: { visible: true, mode: "MINIMIZED" },
211
- isVideoModalDocked: false,
195
+ isVideoModalDocked: jest.fn(() => true),
212
196
  currentRoute: "home",
213
197
  data: {},
214
198
  });
@@ -226,7 +210,7 @@ describe("Layout", () => {
226
210
  mockUseNavigation.mockReturnValueOnce({
227
211
  activeRiver: { navigations: [{ identifier: "quick-brick-bottom-tabs" }] },
228
212
  videoModalState: { visible: false, mode: "MINIMIZED" },
229
- isVideoModalDocked: false,
213
+ isVideoModalDocked: jest.fn(() => false),
230
214
  currentRoute: "home",
231
215
  data: {},
232
216
  });
@@ -256,7 +240,7 @@ describe("Layout", () => {
256
240
  mockUseNavigation.mockReturnValue({
257
241
  activeRiver: { navigations: [] },
258
242
  videoModalState: { visible: true, mode: "FULLSCREEN" },
259
- isVideoModalDocked: false,
243
+ isVideoModalDocked: jest.fn(() => false),
260
244
  currentRoute: "home",
261
245
  data: {},
262
246
  });
@@ -273,7 +257,7 @@ describe("Layout", () => {
273
257
  mockUseNavigation.mockReturnValue({
274
258
  activeRiver: { navigations: [] },
275
259
  videoModalState: { visible: true, mode: "FULLSCREEN" },
276
- isVideoModalDocked: false,
260
+ isVideoModalDocked: jest.fn(() => false),
277
261
  currentRoute: "home",
278
262
  data: {},
279
263
  });
@@ -292,7 +276,7 @@ describe("Layout", () => {
292
276
  mockUseNavigation.mockReturnValue({
293
277
  activeRiver: { navigations: [] },
294
278
  videoModalState: { visible: false, mode: "MINIMIZED" },
295
- isVideoModalDocked: false,
279
+ isVideoModalDocked: jest.fn(() => false),
296
280
  currentRoute: "home",
297
281
  data: {},
298
282
  });
@@ -20,13 +20,18 @@ import {
20
20
  isVideoOverlayVisible,
21
21
  } from "./layoutHelpers";
22
22
 
23
+ import {
24
+ usePlugins,
25
+ useAppSelector,
26
+ selectAppReady,
27
+ } from "@applicaster/zapp-react-native-redux";
28
+
23
29
  import {
24
30
  getMenuPlugin,
25
31
  isBottomTabVisible,
26
32
  isMenuVisible,
27
33
  SIDE_MENU_PLUGIN_ID,
28
34
  } from "@applicaster/zapp-react-native-ui-components/Components/Screen/navigationHandler";
29
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
30
35
 
31
36
  import {
32
37
  MenuToggleContextType,
@@ -52,10 +57,8 @@ const styles = StyleSheet.create({
52
57
  });
53
58
 
54
59
  const LayoutWithMenu = () => {
55
- const {
56
- plugins,
57
- appState: { appReady },
58
- } = usePickFromState(["plugins", "appState"]);
60
+ const plugins = usePlugins();
61
+ const appReady = useAppSelector(selectAppReady);
59
62
 
60
63
  const {
61
64
  toggleMenu,
@@ -140,16 +143,18 @@ const LayoutWithMenu = () => {
140
143
  ? bottomTabBarHeight + safeAreaBottomInset
141
144
  : 0; // if activeRiver?.navigations has quick-brick-bottom-tabs - append bottomTabBarHeight as padding
142
145
 
146
+ const videoModalStateDocked = isVideoModalDocked();
147
+
143
148
  const contentStyle = React.useMemo(
144
149
  () =>
145
150
  StyleSheet.flatten([
146
151
  styles.container,
147
152
  {
148
153
  paddingBottom,
149
- opacity: videoModalState.visible && !isVideoModalDocked ? 0 : 1,
154
+ opacity: videoModalState.visible && !videoModalStateDocked ? 0 : 1,
150
155
  },
151
156
  ]),
152
- [videoModalState.visible, isVideoModalDocked]
157
+ [paddingBottom, videoModalState.visible, videoModalStateDocked]
153
158
  );
154
159
 
155
160
  const menuProps = React.useMemo(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-app",
3
- "version": "15.1.0-rc.1",
3
+ "version": "16.0.0-alpha.9803580571",
4
4
  "description": "Zapp App Component for Applicaster's Quick Brick React Native App",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/quick-brick-core": "15.1.0-rc.1",
31
- "@applicaster/zapp-react-native-bridge": "15.1.0-rc.1",
32
- "@applicaster/zapp-react-native-redux": "15.1.0-rc.1",
33
- "@applicaster/zapp-react-native-ui-components": "15.1.0-rc.1",
34
- "@applicaster/zapp-react-native-utils": "15.1.0-rc.1",
30
+ "@applicaster/quick-brick-core": "16.0.0-alpha.9803580571",
31
+ "@applicaster/zapp-react-native-bridge": "16.0.0-alpha.9803580571",
32
+ "@applicaster/zapp-react-native-redux": "16.0.0-alpha.9803580571",
33
+ "@applicaster/zapp-react-native-ui-components": "16.0.0-alpha.9803580571",
34
+ "@applicaster/zapp-react-native-utils": "16.0.0-alpha.9803580571",
35
35
  "axios": "^0.28.0",
36
36
  "camelize": "^1.0.0",
37
37
  "query-string": "7.1.3",