@applicaster/zapp-react-native-ui-components 16.0.0-rc.36 → 16.0.0-rc.38
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.
|
@@ -23,6 +23,12 @@ type ModalComponentProps = {
|
|
|
23
23
|
maxHeight?: number;
|
|
24
24
|
dismiss: () => void;
|
|
25
25
|
headerComponent?: React.ComponentType;
|
|
26
|
+
|
|
27
|
+
scrollViewContent?: {
|
|
28
|
+
renderItem: (item: any, index: number) => React.ReactNode;
|
|
29
|
+
items: any[];
|
|
30
|
+
} | null;
|
|
31
|
+
|
|
26
32
|
buttonComponent?: React.ComponentType;
|
|
27
33
|
iconProps?: ItemIconProps | ((theme: PluginConfiguration) => ItemIconProps);
|
|
28
34
|
itemProps?:
|
|
@@ -50,6 +56,9 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
|
|
|
50
56
|
summary,
|
|
51
57
|
title,
|
|
52
58
|
headerComponent: ModalHeader = DefaultModalHeader,
|
|
59
|
+
|
|
60
|
+
scrollViewContent = null,
|
|
61
|
+
|
|
53
62
|
buttonComponent: ButtonComponent = Button,
|
|
54
63
|
getSelectedItemIcon = ({
|
|
55
64
|
modal_bottom_sheet_item_selected_icon,
|
|
@@ -109,24 +118,31 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
|
|
|
109
118
|
paddingBottom: paddingBottom + bottomInset,
|
|
110
119
|
}}
|
|
111
120
|
>
|
|
112
|
-
{
|
|
113
|
-
item
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
{scrollViewContent
|
|
122
|
+
? scrollViewContent.items.map((item, index) =>
|
|
123
|
+
scrollViewContent.renderItem(item, index)
|
|
124
|
+
)
|
|
125
|
+
: null}
|
|
126
|
+
|
|
127
|
+
{!scrollViewContent &&
|
|
128
|
+
items.map((item, index) =>
|
|
129
|
+
item ? (
|
|
130
|
+
<ButtonComponent
|
|
131
|
+
key={index}
|
|
132
|
+
configuration={theme}
|
|
133
|
+
selectedItem={current_selection}
|
|
134
|
+
item={item}
|
|
135
|
+
onPress={handlePress}
|
|
136
|
+
label={theme[item?.label] ?? item?.label}
|
|
137
|
+
iconBaseProps={iconBaseProps}
|
|
138
|
+
itemBaseProps={itemBaseProps}
|
|
139
|
+
labelBaseProps={labelBaseProps}
|
|
140
|
+
selectedItemIcon={getSelectedItemIcon(theme)}
|
|
141
|
+
defaultItemIcon={getDefaultItemIcon(theme)}
|
|
142
|
+
iconPlacement={iconPlacement}
|
|
143
|
+
/>
|
|
144
|
+
) : null
|
|
145
|
+
)}
|
|
130
146
|
</ScrollView>
|
|
131
147
|
</View>
|
|
132
148
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import { append, compose, identity,
|
|
3
|
+
import { append, compose, identity, tail, take, update } from "ramda";
|
|
4
4
|
|
|
5
5
|
import { AnimationManager } from "./AnimationManager";
|
|
6
6
|
import { Scene } from "./Scene";
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
shouldSkipAnimationForPreviousWebViewScene,
|
|
11
11
|
} from "./utils";
|
|
12
12
|
import { v4 as uuid_v4 } from "uuid";
|
|
13
|
+
import { isScreenActiveForRoute } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useIsScreenActive";
|
|
13
14
|
|
|
14
15
|
export const NAV_ACTION_PUSH = "PUSH";
|
|
15
16
|
|
|
@@ -50,16 +51,16 @@ function scenesForBackTransition(props: SceneProps, { scenes }) {
|
|
|
50
51
|
: [prepareScene(props.children), scenes[0]];
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
const isModalClosed = (navigator) => {
|
|
54
|
-
return !!isNil(navigator?.modalData);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
54
|
type Props = {
|
|
58
55
|
transitionConfig: any;
|
|
59
56
|
children: React.ReactNode;
|
|
60
57
|
navigator: {
|
|
61
58
|
previousAction: string;
|
|
62
59
|
currentRoute: string;
|
|
60
|
+
videoModalState?: {
|
|
61
|
+
visible?: boolean;
|
|
62
|
+
mode?: string;
|
|
63
|
+
};
|
|
63
64
|
screenData: {
|
|
64
65
|
[key: string]: any;
|
|
65
66
|
};
|
|
@@ -283,8 +284,10 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
|
|
|
283
284
|
// so only a single scene should be rendered,
|
|
284
285
|
// instead of dangerous nulls or duplicates.
|
|
285
286
|
renderSingleScene({ scenes, to }) {
|
|
286
|
-
const { contentStyle } = this.props;
|
|
287
|
-
|
|
287
|
+
const { contentStyle, navigator, children } = this.props;
|
|
288
|
+
|
|
289
|
+
const { currentRoute, videoModalState } = navigator;
|
|
290
|
+
const screenData = children.props.screenData;
|
|
288
291
|
const pathname = scenes[to.index].key;
|
|
289
292
|
|
|
290
293
|
return (
|
|
@@ -293,7 +296,11 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
|
|
|
293
296
|
<Scene
|
|
294
297
|
{...{ style: to?.style || {} }}
|
|
295
298
|
pathname={pathname}
|
|
296
|
-
isActive={
|
|
299
|
+
isActive={isScreenActiveForRoute(
|
|
300
|
+
pathname,
|
|
301
|
+
currentRoute,
|
|
302
|
+
videoModalState
|
|
303
|
+
)}
|
|
297
304
|
contentStyle={contentStyle}
|
|
298
305
|
key={scenes[to.index].key}
|
|
299
306
|
screenUniqueId={scenes[to.index].screenUniqueId}
|
|
@@ -311,16 +318,19 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
|
|
|
311
318
|
// Looks redundant, but when written like this
|
|
312
319
|
// we do not need to pass or generate keys.
|
|
313
320
|
renderScenes({ scenes, from, to }) {
|
|
314
|
-
const { contentStyle } = this.props;
|
|
321
|
+
const { contentStyle, navigator } = this.props;
|
|
322
|
+
|
|
323
|
+
const { currentRoute, videoModalState } = navigator;
|
|
315
324
|
|
|
316
325
|
const fromScene = scenes[from.index] && (
|
|
317
326
|
<Scene
|
|
318
327
|
key={scenes[from.index].key}
|
|
319
328
|
pathname={scenes[from.index].key}
|
|
320
|
-
isActive={
|
|
321
|
-
scenes[from.index].key
|
|
322
|
-
|
|
323
|
-
|
|
329
|
+
isActive={isScreenActiveForRoute(
|
|
330
|
+
scenes[from.index].key,
|
|
331
|
+
currentRoute,
|
|
332
|
+
videoModalState
|
|
333
|
+
)}
|
|
324
334
|
style={from.style}
|
|
325
335
|
pointerEvents="none"
|
|
326
336
|
overlayStyle={from.overlayStyle}
|
|
@@ -336,10 +346,11 @@ export class TransitionerComponent extends React.PureComponent<Props, State> {
|
|
|
336
346
|
const toScene = scenes[to.index] && (
|
|
337
347
|
<Scene
|
|
338
348
|
pathname={scenes[to.index].key}
|
|
339
|
-
isActive={
|
|
340
|
-
scenes[to.index].key
|
|
341
|
-
|
|
342
|
-
|
|
349
|
+
isActive={isScreenActiveForRoute(
|
|
350
|
+
scenes[to.index].key,
|
|
351
|
+
currentRoute,
|
|
352
|
+
videoModalState
|
|
353
|
+
)}
|
|
343
354
|
key={scenes[to.index].key}
|
|
344
355
|
style={to.style}
|
|
345
356
|
overlayStyle={to.overlayStyle}
|
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.
|
|
3
|
+
"version": "16.0.0-rc.38",
|
|
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.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "16.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "16.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "16.0.0-rc.38",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.38",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "16.0.0-rc.38",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "16.0.0-rc.38",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
37
|
"url": "^0.11.0",
|