@applicaster/zapp-react-native-app 15.0.0-rc.99 → 15.1.0-alpha.2915689988

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