@applicaster/zapp-react-native-app 12.0.0-alpha.7257632022 → 12.0.0-alpha.7496053101
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.
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "@applicaster/zapp-react-native-bridge/QuickBrick";
|
|
9
9
|
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
|
|
10
10
|
import { useAnalytics } from "@applicaster/zapp-react-native-utils/analyticsUtils";
|
|
11
|
-
import {
|
|
11
|
+
import { useRivers } from "@applicaster/zapp-react-native-utils/reactHooks/state";
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
children: React.CElement,
|
|
@@ -19,7 +19,7 @@ const getHome = R.compose(R.find(R.propEq("home", true)), R.values);
|
|
|
19
19
|
const InteractionManagerComponent = (props: Props) => {
|
|
20
20
|
const { children } = props;
|
|
21
21
|
const { sendHardwareBackButtonClickEvent } = useAnalytics();
|
|
22
|
-
const
|
|
22
|
+
const rivers = useRivers();
|
|
23
23
|
const navigator = useNavigation();
|
|
24
24
|
|
|
25
25
|
const isHomeScreen = () => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
describe("Layout", () => {
|
|
2
|
+
it.todo("should match snapshot when appReady is true");
|
|
3
|
+
it.todo("should not render transitioner with screen when appReady is false");
|
|
4
|
+
it.todo("should render menu when showMenu is true");
|
|
5
|
+
it.todo("should render VideoModal when visible & VideoModal is true");
|
|
6
|
+
it.todo("should render ZappHooksModal");
|
|
7
|
+
});
|
package/App/Layout/index.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useGetBottomTabBarHeight,
|
|
9
9
|
useNavigation,
|
|
10
10
|
useDimensions,
|
|
11
|
-
|
|
11
|
+
useNavbarState,
|
|
12
12
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
13
13
|
import { Transitioner } from "@applicaster/zapp-react-native-ui-components/Components/Transitioner";
|
|
14
14
|
import { transitionConfig } from "@applicaster/zapp-react-native-ui-components/Components/Transitioner/config";
|
|
@@ -25,9 +25,12 @@ import { VideoModal } from "@applicaster/zapp-react-native-ui-components/Compone
|
|
|
25
25
|
import { withDimensionsProvider } from "@applicaster/zapp-react-native-utils/dimensionsProvider";
|
|
26
26
|
|
|
27
27
|
import { ZappHooksModal } from "@applicaster/zapp-react-dom-ui-components/Components/ZappHooksModal";
|
|
28
|
-
import { useNavbarState } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
29
28
|
import { useListenEventBusEvent } from "@applicaster/zapp-react-native-utils/reactHooks/useListenEventBusEvent";
|
|
30
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
PushTopicManager,
|
|
31
|
+
PushTopicManagerConsts,
|
|
32
|
+
PushTopicManagerEvents,
|
|
33
|
+
} from "@applicaster/zapp-react-native-bridge/PushNotifications/PushTopicManager";
|
|
31
34
|
|
|
32
35
|
type Props = {
|
|
33
36
|
children: React.ReactNode;
|
|
@@ -61,29 +64,21 @@ const LayoutWithMenu = (props: Props) => {
|
|
|
61
64
|
|
|
62
65
|
const dimensions = useDimensions("screen", { fullDimensions: true });
|
|
63
66
|
const isRTL = useIsRTL();
|
|
64
|
-
|
|
65
67
|
const navigator = useNavigation();
|
|
66
68
|
const bottomTabBarHeight = useGetBottomTabBarHeight();
|
|
67
|
-
|
|
68
|
-
const {
|
|
69
|
-
activeRiver,
|
|
70
|
-
currentRoute,
|
|
71
|
-
screenData,
|
|
72
|
-
videoModalState,
|
|
73
|
-
isVideoModalDocked,
|
|
74
|
-
videoModalState: { visible },
|
|
75
|
-
} = navigator;
|
|
76
|
-
|
|
77
|
-
const isNavBarVisible = useIsNavBarVisible();
|
|
78
69
|
const { title } = useNavbarState();
|
|
79
70
|
|
|
80
|
-
const
|
|
81
|
-
() => getNavigationPluginModule("nav_bar", activeRiver, plugins),
|
|
82
|
-
[]
|
|
83
|
-
);
|
|
71
|
+
const { activeRiver, videoModalState, isVideoModalDocked } = navigator;
|
|
84
72
|
|
|
85
73
|
const Menu = React.useMemo(
|
|
86
|
-
() =>
|
|
74
|
+
() =>
|
|
75
|
+
getNavigationPluginModule(
|
|
76
|
+
"menu",
|
|
77
|
+
activeRiver,
|
|
78
|
+
plugins
|
|
79
|
+
) as React.ComponentType<
|
|
80
|
+
MobileNavBarPluginProps & { navigator: ZappNavigation }
|
|
81
|
+
>,
|
|
87
82
|
[]
|
|
88
83
|
);
|
|
89
84
|
|
|
@@ -96,8 +91,8 @@ const LayoutWithMenu = (props: Props) => {
|
|
|
96
91
|
() => ({
|
|
97
92
|
...(showMenu
|
|
98
93
|
? {
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
paddingBottom: bottomTabBarHeight,
|
|
95
|
+
}
|
|
101
96
|
: {}),
|
|
102
97
|
...containerStyle,
|
|
103
98
|
opacity: videoModalState.visible && !isVideoModalDocked ? 0 : 1,
|
|
@@ -105,20 +100,6 @@ const LayoutWithMenu = (props: Props) => {
|
|
|
105
100
|
[bottomTabBarHeight, videoModalState.visible, isVideoModalDocked, showMenu]
|
|
106
101
|
);
|
|
107
102
|
|
|
108
|
-
const navBarProps = React.useMemo(
|
|
109
|
-
() => ({
|
|
110
|
-
setToggleMenu,
|
|
111
|
-
toggleMenu,
|
|
112
|
-
openMenu,
|
|
113
|
-
setOpenMenu,
|
|
114
|
-
closeMenu,
|
|
115
|
-
setCloseMenu,
|
|
116
|
-
navigator,
|
|
117
|
-
...getNavigationProps({ navigator, title, category: "nav_bar" }),
|
|
118
|
-
}),
|
|
119
|
-
[navigator.currentRoute]
|
|
120
|
-
);
|
|
121
|
-
|
|
122
103
|
const menuProps = {
|
|
123
104
|
setToggleMenu: setToggleMenu,
|
|
124
105
|
toggleMenu: toggleMenu,
|
|
@@ -127,7 +108,7 @@ const LayoutWithMenu = (props: Props) => {
|
|
|
127
108
|
closeMenu: closeMenu,
|
|
128
109
|
setCloseMenu: setCloseMenu,
|
|
129
110
|
dimensions: { window: dimensions },
|
|
130
|
-
navigator
|
|
111
|
+
navigator,
|
|
131
112
|
...getNavigationProps({
|
|
132
113
|
navigator,
|
|
133
114
|
title,
|
|
@@ -158,22 +139,20 @@ const LayoutWithMenu = (props: Props) => {
|
|
|
158
139
|
contentStyle={showMenu ? contentStyle : {}}
|
|
159
140
|
isRTL={isRTL}
|
|
160
141
|
>
|
|
142
|
+
{/* has pathname context */}
|
|
161
143
|
<Screen
|
|
162
144
|
key={navigator.currentRoute}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
pathname={currentRoute}
|
|
168
|
-
screenData={screenData}
|
|
169
|
-
isNavBarVisible={isNavBarVisible}
|
|
145
|
+
pathname={navigator.currentRoute} // required by TransitionerComponent
|
|
146
|
+
screenData={navigator.screenData} // required by TransitionerComponent
|
|
147
|
+
setToggleMenu={setToggleMenu}
|
|
148
|
+
setCloseMenu={setCloseMenu}
|
|
170
149
|
/>
|
|
171
150
|
</Transitioner>
|
|
172
151
|
</View>
|
|
173
152
|
) : null}
|
|
174
|
-
{showMenu && <Menu {...menuProps} />}
|
|
175
|
-
{
|
|
176
|
-
|
|
153
|
+
{showMenu && <Menu {...{ ...menuProps, id: navigator.currentRoute }} />}
|
|
154
|
+
{/* depends on active river. @TODO move below screen context */}
|
|
155
|
+
{VideoModal && videoModalState.visible && <VideoModal />}
|
|
177
156
|
<ZappHooksModal />
|
|
178
157
|
</>
|
|
179
158
|
);
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-app",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.7496053101",
|
|
4
4
|
"description": "Zapp App Component for Applicaster's Quick Brick React Native App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest -w=2",
|
|
8
|
+
"build": "echo 'skipping ts build for core packages'",
|
|
8
9
|
"flow-types": "node_modules/.bin/flow-copy-source -v -i '**/__tests__**' . ."
|
|
9
10
|
},
|
|
10
11
|
"repository": {
|
|
@@ -28,12 +29,12 @@
|
|
|
28
29
|
},
|
|
29
30
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@applicaster/quick-brick-core": "12.0.0-alpha.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
34
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
36
|
-
"axios": "^0.
|
|
32
|
+
"@applicaster/quick-brick-core": "12.0.0-alpha.7496053101",
|
|
33
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.7496053101",
|
|
34
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.7496053101",
|
|
35
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.7496053101",
|
|
36
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.7496053101",
|
|
37
|
+
"axios": "^0.28.0",
|
|
37
38
|
"camelize": "^1.0.0",
|
|
38
39
|
"query-string": "7.1.3",
|
|
39
40
|
"react-router-native": "5.1.2",
|