@momo-kits/foundation 0.89.1-rc.1 → 0.89.1-rc.2

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.
@@ -288,6 +288,7 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
288
288
  const HeaderToolkitAction: React.FC<any> = ({
289
289
  tintColor,
290
290
  pinnedTool,
291
+ runtimeTools = [],
291
292
  preventBack,
292
293
  }) => {
293
294
  const {theme, navigator} = useContext(ApplicationContext);
@@ -322,7 +323,7 @@ const HeaderToolkitAction: React.FC<any> = ({
322
323
  onAction?.('onMore');
323
324
  navigator?.maxApi?.dispatchFunction?.(
324
325
  'showTools',
325
- [undefined],
326
+ {runtimeTools},
326
327
  (res: {item: {action?: string; key: string}}) => {
327
328
  const {item} = res;
328
329
  navigator?.toolkitCallback?.(item);
@@ -139,13 +139,22 @@ export type PinnedToolType = {
139
139
  badgeType?: 'number' | 'dot';
140
140
  };
141
141
 
142
+ export type RuntimeToolType = {
143
+ title: {vi: string; en: string};
144
+ icon: string;
145
+ key: string;
146
+ };
147
+
142
148
  export interface NavigationOptions extends StackNavigationOptions {
143
149
  preventBack?: PopupNotifyProps;
144
150
  onPressLeftHeader?: () => void;
145
151
  surface?: boolean;
146
152
  hiddenBack?: boolean;
147
153
  customTitle?: TitleCustomProps;
148
- pinnedTool?: PinnedToolType;
154
+ toolkitParams?: {
155
+ pinnedTool?: PinnedToolType;
156
+ runtimeTools?: RuntimeToolType[];
157
+ };
149
158
  }
150
159
 
151
160
  export interface HeaderBackProps extends NavigationButtonProps {
@@ -126,14 +126,15 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
126
126
  };
127
127
  }
128
128
 
129
- if (params.pinnedTool) {
129
+ if (params.toolkitParams) {
130
130
  options = {
131
131
  ...options,
132
132
  headerRight: (props: any) => {
133
133
  return (
134
134
  <HeaderToolkitAction
135
135
  preventBack={params.preventBack}
136
- pinnedTool={params.pinnedTool}
136
+ pinnedTool={params.toolkitParams?.pinnedTool}
137
+ runtimeTools={params.toolkitParams?.runtimeTools}
137
138
  {...props}
138
139
  />
139
140
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.89.1-rc.1",
3
+ "version": "0.89.1-rc.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {