@@ -57,6 +57,10 @@ export default class Badge extends PureBaseComponent {
57
57
* width of border around the badge
58
58
*/
59
59
borderWidth : PropTypes . number ,
60
+ /**
61
+ * radius of border around the badge
62
+ */
63
+ borderRadius : PropTypes . number ,
60
64
/**
61
65
* color of border around the badge
62
66
*/
@@ -174,11 +178,16 @@ export default class Badge extends PureBaseComponent {
174
178
}
175
179
176
180
getBorderStyling ( ) {
177
- const { borderWidth, borderColor} = this . props ;
178
- return {
179
- borderWidth,
180
- borderColor
181
- } ;
181
+ const { borderWidth, borderColor, borderRadius} = this . props ;
182
+ const style = { } ;
183
+ if ( borderWidth ) {
184
+ style . borderWidth = borderWidth ;
185
+ style . borderColor = borderColor ;
186
+ }
187
+ if ( borderRadius ) {
188
+ style . borderRadius = borderRadius ;
189
+ }
190
+ return style ;
182
191
}
183
192
184
193
renderLabel ( ) {
@@ -218,7 +227,6 @@ export default class Badge extends PureBaseComponent {
218
227
// TODO: remove testId after deprecation
219
228
const {
220
229
activeOpacity,
221
- borderWidth,
222
230
backgroundColor,
223
231
containerStyle,
224
232
hitSlop,
@@ -230,7 +238,7 @@ export default class Badge extends PureBaseComponent {
230
238
} = this . props ;
231
239
const backgroundStyle = backgroundColor && { backgroundColor} ;
232
240
const sizeStyle = this . getBadgeSizeStyle ( ) ;
233
- const borderStyle = borderWidth ? this . getBorderStyling ( ) : undefined ;
241
+ const borderStyle = this . getBorderStyling ( ) ;
234
242
235
243
const animationProps = this . extractAnimationProps ( ) ;
236
244
const Container = ! _ . isEmpty ( animationProps ) ? AnimatableView : onPress ? TouchableOpacity : View ;
@@ -240,7 +248,7 @@ export default class Badge extends PureBaseComponent {
240
248
}
241
249
return (
242
250
// The extra View wrapper is to break badge's flex-ness
243
- < View style = { containerStyle } { ...others } backgroundColor = { undefined } { ...this . getAccessibilityProps ( ) } >
251
+ < View style = { containerStyle } { ...others } backgroundColor = { undefined } borderWidth = { undefined } { ...this . getAccessibilityProps ( ) } >
244
252
< Container
245
253
testID = { testID || testId }
246
254
pointerEvents = { 'none' }
0 commit comments