Skip to content

Commit c87a772

Browse files
author
Sankhadeep
committed
badge & header fixed
1 parent 1e72a3a commit c87a772

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

Components/Widgets/Badge.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export default class BadgeNB extends NativeBaseComponent {
1717
backgroundColor: this.props.primary ? this.getTheme().brandPrimary : this.props.success ? this.getTheme().brandSuccess :
1818
this.props.info ? this.getTheme().brandInfo : this.props.warning ? this.getTheme().brandWarning :
1919
this.props.danger ? this.getTheme().brandDanger : this.getTheme().badgeBg,
20-
padding: 4,
20+
padding: 3,
21+
paddingHorizontal: 10,
2122
alignSelf: 'flex-start',
22-
borderRadius: 13,
23-
width: 27,
23+
borderRadius: 13.5,
2424
height: 27
2525

2626

@@ -38,7 +38,7 @@ export default class BadgeNB extends NativeBaseComponent {
3838
<View {...this.prepareRootProps()}>
3939
<Text style={{ color: (this.props.textStyle && this.props.textStyle.color) ? this.props.textStyle.color : this.getTheme().badgeColor,
4040
fontSize: this.getTheme().fontSizeBase,
41-
lineHeight: this.getTheme().lineHeight-2,
41+
lineHeight: this.getTheme().lineHeight-1,
4242
textAlign: 'center'}}>{this.props.children}
4343
</Text>
4444
</View>

Components/Widgets/Header.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,17 @@ export default class Header extends NativeBaseComponent {
119119
newChildren.push(<View key='title' style={{flex: 3, alignSelf: 'center', justifyContent: 'space-between'}}>
120120
{[title[0],subtitle[0]]}
121121
</View>)
122-
for (let i = 1; i < buttons.length; i++) {
123-
newChildren.push(<View key={'btn' + (i+1)} style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -14}}>
124-
{React.cloneElement(buttons[i], {color: this.getTheme().iosToolbarBtnColor, style: this.getInitialStyle().toolbarButton})}
125-
</View>)
122+
if (buttons.length>1) {
123+
for (let i = 1; i < buttons.length; i++) {
124+
newChildren.push(<View key={'btn' + (i+1)} style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -14}}>
125+
{React.cloneElement(buttons[i], {color: this.getTheme().iosToolbarBtnColor, style: this.getInitialStyle().toolbarButton})}
126+
</View>)
127+
}
128+
} else {
129+
newChildren.push(<Button key='fakeBtn' transparent textStyle={{color:'transparent'}}>aa</Button>)
126130
}
127-
} else {
131+
}
132+
else {
128133
newChildren.push(<View key='btn1' style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -10, marginRight: 12}}>
129134
{React.cloneElement(buttons[0], {style: this.getInitialStyle().toolbarButton, header : true, textStyle: {color: this.getTheme().toolbarTextColor}})}
130135
</View>)

0 commit comments

Comments
 (0)