@momo-kits/foundation 0.81.41-beta.10 → 0.81.41-beta.11
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.
|
@@ -349,7 +349,7 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
|
|
|
349
349
|
|
|
350
350
|
const HeaderToolkitAction: React.FC<any> = ({
|
|
351
351
|
tintColor,
|
|
352
|
-
pinnedTool,
|
|
352
|
+
pinnedTool = {key: '', badgeValue: undefined, badgeTye: undefined},
|
|
353
353
|
preventBack,
|
|
354
354
|
}) => {
|
|
355
355
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
@@ -459,17 +459,17 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
459
459
|
const pinTool = toolConfig?.configs?.find(
|
|
460
460
|
(i: any) => i.key === pinnedTool.key,
|
|
461
461
|
);
|
|
462
|
-
|
|
463
|
-
const badgeType =
|
|
464
|
-
const validatedBadgeValue = isNaN(Number(badgeValue)) ? badgeValue : null;
|
|
462
|
+
|
|
463
|
+
const {badgeValue, badgeType} = pinnedTool;
|
|
465
464
|
const {icon} = pinTool || '';
|
|
465
|
+
|
|
466
466
|
if (pinTool && pinnedTool)
|
|
467
467
|
return (
|
|
468
468
|
<NavigationButton
|
|
469
469
|
accessibilityLabel={'UtilityTool'}
|
|
470
470
|
icon={icon as string}
|
|
471
471
|
tintColor={tintColor}
|
|
472
|
-
badgeValue={
|
|
472
|
+
badgeValue={badgeValue}
|
|
473
473
|
badgeType={badgeType}
|
|
474
474
|
onPress={() => {
|
|
475
475
|
navigator?.toolkitCallback?.(pinnedTool.key);
|
package/Application/types.ts
CHANGED
|
@@ -128,14 +128,14 @@ export type NavigationButtonProps = {
|
|
|
128
128
|
useBorder?: boolean;
|
|
129
129
|
onPress: () => void;
|
|
130
130
|
accessibilityLabel?: string;
|
|
131
|
-
badgeType?: 'dot' | 'number'
|
|
132
|
-
badgeValue?: number
|
|
131
|
+
badgeType?: 'dot' | 'number';
|
|
132
|
+
badgeValue?: number;
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
export type PinnedToolType = {
|
|
136
136
|
key: string;
|
|
137
137
|
badgeValue?: number;
|
|
138
|
-
|
|
138
|
+
badgeType?: 'number' | 'dot';
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
export interface NavigationOptions extends StackNavigationOptions {
|