@@ -14,7 +14,6 @@ import Indicator from './Indicator';
14
14
import { ContentType } from './Tab/Tab' ;
15
15
16
16
import { Bar , TabTrack } from '../lib/styles' ;
17
- import constants from '../lib/constants' ;
18
17
19
18
interface Props extends Pick < ScrollViewProps , 'keyboardShouldPersistTaps' > {
20
19
allowFontScaling : boolean ;
@@ -30,6 +29,7 @@ interface Props extends Pick<ScrollViewProps, 'keyboardShouldPersistTaps'> {
30
29
items : ContentType [ ] ;
31
30
uppercase : boolean ;
32
31
onChange ( index : number ) : void ;
32
+ indicatorHeight : number ;
33
33
}
34
34
35
35
const getKeyForTab = ( item : ContentType ) =>
@@ -50,6 +50,7 @@ const MaterialTabs: React.FC<Props> = ({
50
50
uppercase,
51
51
indicatorColor,
52
52
barColor,
53
+ indicatorHeight,
53
54
} ) => {
54
55
const [ tabWidth , setTabWidth ] = useState ( 0 ) ;
55
56
const [ barWidth , setBarWidth ] = useState ( 0 ) ;
@@ -143,7 +144,7 @@ const MaterialTabs: React.FC<Props> = ({
143
144
keyboardShouldPersistTaps = { keyboardShouldPersistTaps }
144
145
scrollEnabled = { scrollable }
145
146
>
146
- < TabTrack barHeight = { barHeight } >
147
+ < TabTrack barHeight = { barHeight } indicatorHeight = { indicatorHeight } >
147
148
{ items . map ( ( item , idx ) => (
148
149
< Tab
149
150
allowFontScaling = { allowFontScaling }
@@ -166,6 +167,7 @@ const MaterialTabs: React.FC<Props> = ({
166
167
color = { indicatorColor }
167
168
value = { indicatorPosition }
168
169
tabWidth = { ! scrollable ? tabWidth : barWidth * 0.4 }
170
+ height = { indicatorHeight }
169
171
/>
170
172
</ ScrollView >
171
173
</ Bar >
@@ -177,13 +179,14 @@ MaterialTabs.defaultProps = {
177
179
allowFontScaling : true ,
178
180
selectedIndex : 0 ,
179
181
barColor : '#13897b' ,
180
- barHeight : constants . barHeight ,
182
+ barHeight : 48 ,
181
183
activeTextColor : '#fff' ,
182
184
indicatorColor : '#fff' ,
183
185
inactiveTextColor : 'rgba(255, 255, 255, 0.7)' ,
184
186
scrollable : false ,
185
187
uppercase : true ,
186
188
keyboardShouldPersistTaps : 'never' ,
189
+ indicatorHeight : 2 ,
187
190
} ;
188
191
189
192
export default MaterialTabs ;
0 commit comments