Skip to content

Commit 95236b0

Browse files
committed
Badge - merge fixes
1 parent d3c0329 commit 95236b0

File tree

1 file changed

+2
-69
lines changed

1 file changed

+2
-69
lines changed

src/components/badge/index.tsx

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -18,76 +18,9 @@ import TouchableOpacity from '../touchableOpacity';
1818
import Image from '../image';
1919
import View from '../view';
2020

21-
2221
const DEFAULT_SIZE = 16;
2322
const LABEL_FORMATTER_VALUES = [1, 2, 3, 4] as const;
24-
type LabelFormatterValues = typeof LABEL_FORMATTER_VALUES[number]
25-
26-
export type BadgeProps = ViewProps & TouchableOpacityProps & {
27-
/**
28-
* Text to show inside the badge.
29-
* Not passing a label (undefined) will present a pimple badge.
30-
*/
31-
label?: string;
32-
/**
33-
* Color of the badge background
34-
*/
35-
backgroundColor?: string;
36-
/**
37-
* the badge size
38-
*/
39-
size: number;
40-
/**
41-
* Press handler
42-
*/
43-
onPress?: (props: any) => void;
44-
/**
45-
* Defines how far a touch event can start away from the badge.
46-
*/
47-
hitSlop?: ViewProps['hitSlop'];
48-
/**
49-
* width of border around the badge
50-
*/
51-
borderWidth?: number;
52-
/**
53-
* radius of border around the badge
54-
*/
55-
borderRadius?: number;
56-
/**
57-
* color of border around the badge
58-
*/
59-
borderColor?: ImageStyle['borderColor'];
60-
/**
61-
* Additional styles for the top container
62-
*/
63-
containerStyle?: StyleProp<ViewStyle>
64-
/**
65-
* Additional styles for the badge label
66-
*/
67-
labelStyle?: TextStyle;
68-
/**
69-
* Receives a number from 1 to 4, representing the label's max digit length.
70-
* Beyond the max number for that digit length, a "+" will show at the end.
71-
* If set to a value not included in LABEL_FORMATTER_VALUES, no formatting will occur.
72-
* Example: labelLengthFormatter={2}, label={124}, label will present "99+".
73-
*/
74-
labelFormatterLimit?: LabelFormatterValues;
75-
/**
76-
* Renders an icon badge
77-
*/
78-
icon?: ImageSourcePropType;
79-
/**
80-
* Additional styling to badge icon
81-
*/
82-
iconStyle?: object;
83-
/**
84-
* Additional props passed to icon
85-
*/
86-
iconProps?: object;
87-
}
88-
8923
type LabelFormatterValues = typeof LABEL_FORMATTER_VALUES[number];
90-
export type BadgeSizes = keyof typeof BADGE_SIZES;
9124

9225
export type BadgeProps = ViewProps &
9326
TouchableOpacityProps & {
@@ -103,7 +36,7 @@ export type BadgeProps = ViewProps &
10336
/**
10437
* the badge size (default, small)
10538
*/
106-
size: BadgeSizes | number;
39+
size: number;
10740
/**
10841
* Press handler
10942
*/
@@ -136,7 +69,7 @@ export type BadgeProps = ViewProps &
13669
* Receives a number from 1 to 4, representing the label's max digit length.
13770
* Beyond the max number for that digit length, a "+" will show at the end.
13871
* If set to a value not included in LABEL_FORMATTER_VALUES, no formatting will occur.
139-
* Example: labelLengthFormater={2}, label={124}, label will present "99+".
72+
* Example: labelLengthFormatter={2}, label={124}, label will present "99+".
14073
*/
14174
labelFormatterLimit?: LabelFormatterValues;
14275
/**

0 commit comments

Comments
 (0)