@@ -5,12 +5,14 @@ import PropTypes from 'prop-types';
5
5
import { Animated , ScrollView , View , Text } from 'react-native' ;
6
6
import type { StyleObj } from '../lib/definitions' ;
7
7
import { Bar , TabTrack } from '../lib/styles' ;
8
+ import values from '../lib/values' ;
8
9
import Tab from './Tab' ;
9
10
import Indicator from './Indicator' ;
10
11
11
12
type Props = {
12
13
selectedIndex : number ,
13
14
barColor : string ,
15
+ barHeight : number ,
14
16
activeTextColor : string ,
15
17
indicatorColor : string ,
16
18
inactiveTextColor : string ,
@@ -42,6 +44,7 @@ export default class MaterialTabs extends React.Component<Props, State> {
42
44
static defaultProps = {
43
45
selectedIndex : 0 ,
44
46
barColor : '#13897b' ,
47
+ barHeight : values . barHeight ,
45
48
activeTextColor : '#fff' ,
46
49
indicatorColor : '#fff' ,
47
50
inactiveTextColor : 'rgba(255, 255, 255, 0.7)' ,
@@ -149,6 +152,7 @@ export default class MaterialTabs extends React.Component<Props, State> {
149
152
< Bar
150
153
innerRef = { ref => ( this . bar = ref ) }
151
154
barColor = { this . props . barColor }
155
+ barHeight = { this . props . barHeight }
152
156
onLayout = { event => this . getTabWidth ( event . nativeEvent . layout . width ) }
153
157
>
154
158
< ScrollView
@@ -157,7 +161,7 @@ export default class MaterialTabs extends React.Component<Props, State> {
157
161
showsHorizontalScrollIndicator = { false }
158
162
scrollEnabled = { this . props . scrollable }
159
163
>
160
- < TabTrack >
164
+ < TabTrack barHeight = { this . props . barHeight } >
161
165
{ this . props . items . map ( ( item , idx ) => (
162
166
< Tab
163
167
text = { item }
@@ -167,6 +171,7 @@ export default class MaterialTabs extends React.Component<Props, State> {
167
171
active = { idx === this . props . selectedIndex }
168
172
activeTextColor = { this . props . activeTextColor }
169
173
textStyle = { this . props . textStyle }
174
+ tabHeight = { this . props . barHeight }
170
175
tabWidth = {
171
176
! this . props . scrollable
172
177
? this . state . tabWidth
0 commit comments