@applicaster/zapp-react-native-ui-components 13.0.0-rc.123 → 13.0.0-rc.124

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.
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from "react";
2
- import { View, ScrollView, Platform } from "react-native";
2
+ import { View, ScrollView } from "react-native";
3
3
  import { Button } from "./Button";
4
4
  import { ItemIconProps } from "./Button/ItemIcon";
5
5
  import { ItemProps } from "./Button/Item";
@@ -9,7 +9,7 @@ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
9
9
 
10
10
  import type { PluginConfiguration } from "./";
11
11
 
12
- import { ModalHeader } from "./Header";
12
+ import { ModalHeader as DefaultModalHeader } from "./Header";
13
13
  import { useSafeAreaInsets } from "react-native-safe-area-context";
14
14
 
15
15
  type ModalComponentProps = {
@@ -22,6 +22,7 @@ type ModalComponentProps = {
22
22
  title?: string;
23
23
  maxHeight?: number;
24
24
  dismiss: () => void;
25
+ headerComponent?: React.ComponentType;
25
26
  buttonComponent?: React.ComponentType;
26
27
  iconProps?: ItemIconProps | ((theme: PluginConfiguration) => ItemIconProps);
27
28
  itemProps?:
@@ -48,9 +49,11 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
48
49
  dismiss,
49
50
  summary,
50
51
  title,
52
+ headerComponent: ModalHeader = DefaultModalHeader,
51
53
  buttonComponent: ButtonComponent = Button,
52
- getSelectedItemIcon = (theme) =>
53
- theme.modal_bottom_sheet_item_selected_icon,
54
+ getSelectedItemIcon = ({
55
+ modal_bottom_sheet_item_selected_icon,
56
+ }: BaseThemePropertiesMobile) => modal_bottom_sheet_item_selected_icon,
54
57
  getDefaultItemIcon = () => null,
55
58
  iconPlacement,
56
59
  } = props;
@@ -103,26 +106,27 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
103
106
  />
104
107
  <ScrollView
105
108
  contentContainerStyle={{
106
- paddingBottom:
107
- paddingBottom + (Platform.OS === "ios" ? bottomInset : 0),
109
+ paddingBottom: paddingBottom + bottomInset,
108
110
  }}
109
111
  >
110
- {items.map((item, index) => (
111
- <ButtonComponent
112
- key={index}
113
- configuration={theme}
114
- selectedItem={current_selection}
115
- item={item}
116
- onPress={handlePress}
117
- label={theme[item?.label] ?? item?.label}
118
- iconBaseProps={iconBaseProps}
119
- itemBaseProps={itemBaseProps}
120
- labelBaseProps={labelBaseProps}
121
- selectedItemIcon={getSelectedItemIcon(theme)}
122
- defaultItemIcon={getDefaultItemIcon(theme)}
123
- iconPlacement={iconPlacement}
124
- />
125
- ))}
112
+ {items.map((item, index) =>
113
+ item ? (
114
+ <ButtonComponent
115
+ key={index}
116
+ configuration={theme}
117
+ selectedItem={current_selection}
118
+ item={item}
119
+ onPress={handlePress}
120
+ label={theme[item?.label] ?? item?.label}
121
+ iconBaseProps={iconBaseProps}
122
+ itemBaseProps={itemBaseProps}
123
+ labelBaseProps={labelBaseProps}
124
+ selectedItemIcon={getSelectedItemIcon(theme)}
125
+ defaultItemIcon={getDefaultItemIcon(theme)}
126
+ iconPlacement={iconPlacement}
127
+ />
128
+ ) : null
129
+ )}
126
130
  </ScrollView>
127
131
  </View>
128
132
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-rc.123",
3
+ "version": "13.0.0-rc.124",
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",
@@ -31,10 +31,10 @@
31
31
  "redux-mock-store": "^1.5.3"
32
32
  },
33
33
  "dependencies": {
34
- "@applicaster/applicaster-types": "13.0.0-rc.123",
35
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.123",
36
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.123",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.123",
34
+ "@applicaster/applicaster-types": "13.0.0-rc.124",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.124",
36
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.124",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.124",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",