11import * as React from 'react' ;
2+ import { View , ViewProps } from 'react-native' ;
23import { DeepPartial } from 'ts-essentials' ;
34
45import { Theme , withTheme } from '../../theme' ;
@@ -13,7 +14,7 @@ import {
1314 getBadgeStyles ,
1415} from './Badge.styles' ;
1516
16- export interface BadgeProps {
17+ export interface BadgeProps extends ViewProps {
1718 children : React . ReactNode ;
1819 theme : Theme ;
1920 color ?: FillColor ;
@@ -32,29 +33,16 @@ const BadgeBase = (props: BadgeProps) => {
3233 shape = 'rounded' ,
3334 size = 'small' ,
3435 theme,
36+ ...viewProps
3537 } = props ;
3638
37- const { boxStyle , textStyle } = mergeStyles ( getBadgeStyles , getStyles ) (
38- { size, color, isSolid } ,
39+ const { containerStyle , textStyle } = mergeStyles ( getBadgeStyles , getStyles ) (
40+ { size, color, isSolid, shape } ,
3941 theme ,
4042 ) ;
4143
4244 return (
43- < Box
44- shape = { shape }
45- style = { {
46- alignItems : 'center' ,
47- alignSelf : 'flex-start' ,
48- backgroundColor : boxStyle . backgroundColor ,
49- display : 'flex' ,
50- flexDirection : 'row' ,
51- height : boxStyle . height ,
52- justifyContent : 'center' ,
53- paddingLeft : boxStyle . paddingLeft ,
54- paddingRight : boxStyle . paddingRight ,
55- ...boxStyle ,
56- } }
57- >
45+ < View style = { containerStyle } { ...viewProps } >
5846 < Strong
5947 size = { size }
6048 getStyles = { ( ) => ( {
@@ -63,7 +51,7 @@ const BadgeBase = (props: BadgeProps) => {
6351 >
6452 { children }
6553 </ Strong >
66- </ Box >
54+ </ View >
6755 ) ;
6856} ;
6957
0 commit comments