@momo-kits/foundation 0.89.1-beta.2 → 0.89.1-beta.3
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
|
-
{runtimeTools
|
|
326
|
+
{runtimeTools},
|
|
326
327
|
(res: {item: {action?: string; key: string}}) => {
|
|
327
328
|
const {item} = res;
|
|
328
329
|
navigator?.toolkitCallback?.(item);
|
package/Application/Navigator.ts
CHANGED
|
@@ -12,7 +12,6 @@ class Navigator {
|
|
|
12
12
|
maxApi?: any;
|
|
13
13
|
dismissData?: any;
|
|
14
14
|
toolkitCallback?: (item: any) => void;
|
|
15
|
-
runtimeTools?: any[] = [];
|
|
16
15
|
|
|
17
16
|
constructor(navigation: any) {
|
|
18
17
|
this.ref = navigation;
|
|
@@ -115,10 +114,6 @@ class Navigator {
|
|
|
115
114
|
) => {
|
|
116
115
|
this.toolkitCallback = callback;
|
|
117
116
|
};
|
|
118
|
-
|
|
119
|
-
setRuntimeTool = (tools: any[]) => {
|
|
120
|
-
this.runtimeTools = tools;
|
|
121
|
-
};
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
export default Navigator;
|
package/Application/types.ts
CHANGED
|
@@ -139,13 +139,18 @@ export type PinnedToolType = {
|
|
|
139
139
|
badgeType?: 'number' | 'dot';
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
+
export type RuntimeToolType = {};
|
|
143
|
+
|
|
142
144
|
export interface NavigationOptions extends StackNavigationOptions {
|
|
143
145
|
preventBack?: PopupNotifyProps;
|
|
144
146
|
onPressLeftHeader?: () => void;
|
|
145
147
|
surface?: boolean;
|
|
146
148
|
hiddenBack?: boolean;
|
|
147
149
|
customTitle?: TitleCustomProps;
|
|
148
|
-
|
|
150
|
+
toolkitParams?: {
|
|
151
|
+
pinnedTool?: PinnedToolType;
|
|
152
|
+
runtimeTool?: RuntimeToolType;
|
|
153
|
+
};
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
export interface HeaderBackProps extends NavigationButtonProps {
|
package/Application/utils.tsx
CHANGED
|
@@ -126,14 +126,15 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
if (params.
|
|
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?.runtimeTool}
|
|
137
138
|
{...props}
|
|
138
139
|
/>
|
|
139
140
|
);
|