@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
- const {badgeValue, showBadge} = pinnedTool;
463
- const badgeType = showBadge && badgeValue ? 'number' : 'dot';
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={validatedBadgeValue}
472
+ badgeValue={badgeValue}
473
473
  badgeType={badgeType}
474
474
  onPress={() => {
475
475
  navigator?.toolkitCallback?.(pinnedTool.key);
@@ -128,14 +128,14 @@ export type NavigationButtonProps = {
128
128
  useBorder?: boolean;
129
129
  onPress: () => void;
130
130
  accessibilityLabel?: string;
131
- badgeType?: 'dot' | 'number' | 'string';
132
- badgeValue?: number | string;
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
- showBadge?: boolean;
138
+ badgeType?: 'number' | 'dot';
139
139
  };
140
140
 
141
141
  export interface NavigationOptions extends StackNavigationOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.41-beta.10",
3
+ "version": "0.81.41-beta.11",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {