@momo-kits/foundation 0.169.11-beta.5 → 0.169.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.
|
@@ -13,9 +13,6 @@ import { Text } from '../../Text';
|
|
|
13
13
|
import ScaleSizeProvider from '../ScaleSizeProvider';
|
|
14
14
|
import { TabBarMetrics, TabBarMotion } from './metrics';
|
|
15
15
|
|
|
16
|
-
// text badges keep 5 characters, then "..." ("Khám phá" -> "Khám...")
|
|
17
|
-
const BADGE_MAX_CHARS = 5;
|
|
18
|
-
|
|
19
16
|
type Props = {
|
|
20
17
|
focused: boolean;
|
|
21
18
|
// '' shows a dot, anything else a label badge
|
|
@@ -33,7 +30,7 @@ type Props = {
|
|
|
33
30
|
|
|
34
31
|
/**
|
|
35
32
|
* Badge value of a tab: undefined hides it, '' is a dot (also 0 when `showDot`), numbers
|
|
36
|
-
* cap at 99
|
|
33
|
+
* cap at 99+.
|
|
37
34
|
*/
|
|
38
35
|
export const getTabBadge = (
|
|
39
36
|
badgeLabel?: string | number,
|
|
@@ -53,9 +50,7 @@ export const getTabBadge = (
|
|
|
53
50
|
}
|
|
54
51
|
return value > 99 ? '99+' : text;
|
|
55
52
|
}
|
|
56
|
-
return text
|
|
57
|
-
? `${text.slice(0, BADGE_MAX_CHARS).trimEnd()}...`
|
|
58
|
-
: text;
|
|
53
|
+
return text;
|
|
59
54
|
};
|
|
60
55
|
|
|
61
56
|
/**
|