@@ -10,7 +10,6 @@ import {
10
10
ViewStyle ,
11
11
TextStyle
12
12
} from 'react-native' ;
13
- import { LogService } from '../../services' ;
14
13
import { Constants } from '../../helpers' ;
15
14
import { Colors , Typography , Spacings } from '../../style' ;
16
15
import { asBaseComponent } from '../../commons/new' ;
@@ -20,6 +19,7 @@ import Text from '../text';
20
19
import Image from '../image' ;
21
20
import Badge , { BadgeProps } from '../badge' ;
22
21
22
+
23
23
const INDICATOR_HEIGHT = 2 ;
24
24
const INDICATOR_BG_COLOR = Colors . primary ;
25
25
const HORIZONTAL_PADDING = Constants . isTablet ? Spacings . s7 : Spacings . s5 ;
@@ -46,9 +46,8 @@ export interface TabBarItemProps {
46
46
*/
47
47
labelStyle ?: StyleProp < TextStyle > ;
48
48
/**
49
- * Badge component props to display next the item label
49
+ * Badge component's props to display next the item label
50
50
*/
51
- badge ?: BadgeProps ; //TODO: remove after deprecation
52
51
badgeProps ?: BadgeProps ;
53
52
/**
54
53
* Pass to render a leading element
@@ -131,10 +130,6 @@ class TabBarItem extends PureComponent<TabBarItemProps, State> {
131
130
indicatorOpacity : props . selected ? new Animated . Value ( 1 ) : new Animated . Value ( 0 ) ,
132
131
selected : props . selected
133
132
} ;
134
-
135
- if ( ! _ . isEmpty ( props . badge ) ) {
136
- LogService . deprecationWarn ( { component : 'TabBarItem' , oldProp : 'badge' , newProp : 'badgeProps' } ) ;
137
- }
138
133
}
139
134
140
135
componentDidUpdate ( prevProps : TabBarItemProps ) {
@@ -193,7 +188,6 @@ class TabBarItem extends PureComponent<TabBarItemProps, State> {
193
188
label,
194
189
labelStyle,
195
190
badgeProps,
196
- badge,
197
191
leadingAccessory,
198
192
trailingAccessory,
199
193
uppercase,
@@ -212,8 +206,7 @@ class TabBarItem extends PureComponent<TabBarItemProps, State> {
212
206
const iconTint = iconColor || this . getColorFromStyle ( labelStyle ) || this . getColorFromStyle ( styles . label ) ;
213
207
const iconSelectedTint =
214
208
iconSelectedColor || this . getColorFromStyle ( selectedLabelStyle ) || this . getColorFromStyle ( styles . selectedLabel ) ;
215
- const badgeFinalProps = badgeProps || badge ;
216
- const badgeSize = _ . get ( badgeFinalProps , 'size' , 16 ) ;
209
+ const badgeSize = _ . get ( badgeProps , 'size' , 16 ) ;
217
210
218
211
return (
219
212
< TouchableOpacity
@@ -247,12 +240,12 @@ class TabBarItem extends PureComponent<TabBarItemProps, State> {
247
240
</ Text >
248
241
) }
249
242
{ children }
250
- { ! _ . isNil ( badgeFinalProps ) && (
243
+ { ! _ . isNil ( badgeProps ) && (
251
244
< Badge
252
245
backgroundColor = { Colors . red30 }
253
- { ...badgeFinalProps }
246
+ { ...badgeProps }
254
247
size = { badgeSize }
255
- containerStyle = { [ styles . badge , badgeFinalProps . containerStyle ] }
248
+ containerStyle = { [ styles . badge , badgeProps . containerStyle ] }
256
249
/>
257
250
) }
258
251
{ trailingAccessory }
0 commit comments