Skip to content

Commit d5cce2f

Browse files
author
Artur Yorsh
committed
fix(tab-set): tabBar styles
1 parent c1ec7a3 commit d5cce2f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/tabset/rkTabBar.component.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
View,
55
TouchableOpacity,
66
StyleSheet,
7+
ViewPropTypes,
78
} from 'react-native';
89
import { RkTab } from './rkTab.component';
910

@@ -12,6 +13,7 @@ export class RkTabBar extends React.Component {
1213
children: PropTypes.arrayOf(PropTypes.instanceOf(RkTab)).isRequired,
1314
selectedIndex: PropTypes.number,
1415
onSelect: PropTypes.func,
16+
...ViewPropTypes,
1517
};
1618
static defaultProps = {
1719
selectedIndex: 0,
@@ -27,21 +29,24 @@ export class RkTabBar extends React.Component {
2729
};
2830

2931
renderChild = (item, index) => (
30-
<TouchableOpacity key={index.toString()} onPress={() => this.onChildPress(index)}>
32+
<TouchableOpacity
33+
key={index.toString()}
34+
activeOpacity={0.5}
35+
onPress={() => this.onChildPress(index)}>
3136
{ React.cloneElement(item, { isSelected: this.props.selectedIndex === index }) }
3237
</TouchableOpacity>
3338
);
3439

3540
renderChildComponents = () => this.props.children.map(this.renderChild);
3641

3742
render = () => (
38-
<View style={styles.container}>{this.renderChildComponents()}</View>
43+
<View style={[this.props.style, styles.container]}>{this.renderChildComponents()}</View>
3944
);
4045
}
4146

4247
const styles = StyleSheet.create({
4348
container: {
4449
flexDirection: 'row',
45-
justifyContent: 'space-between',
50+
justifyContent: 'space-around',
4651
},
4752
});

0 commit comments

Comments
 (0)