@@ -171,21 +171,29 @@ export default class TabBarItem extends PureComponent {
171
171
172
172
const labelStyle = this . props . labelStyle ;
173
173
const selectedLabelStyle = this . props . selectedLabelStyle ;
174
+ let fontWeight , letterSpacing , fontFamily ;
175
+
176
+ if ( labelStyle . fontWeight || selectedLabelStyle . fontWeight ) {
177
+ fontWeight = cond ( and ( eq ( targetPage , index ) , defined ( itemWidth ) ) ,
178
+ selectedLabelStyle . fontWeight || 'normal' ,
179
+ labelStyle . fontWeight || 'normal' ) ;
180
+ }
181
+
182
+ if ( labelStyle . letterSpacing || selectedLabelStyle . letterSpacing ) {
183
+ letterSpacing = cond ( and ( eq ( targetPage , index ) , defined ( itemWidth ) ) ,
184
+ selectedLabelStyle . letterSpacing || 0 ,
185
+ labelStyle . letterSpacing || 0 ) ;
186
+ }
187
+
188
+ if ( labelStyle . fontFamily || selectedLabelStyle . fontFamily ) {
189
+ fontFamily = cond ( and ( eq ( targetPage , index ) , defined ( itemWidth ) ) ,
190
+ selectedLabelStyle . fontFamily ,
191
+ labelStyle . fontFamily ) ;
192
+ }
174
193
175
- const fontWeight = cond ( and ( eq ( targetPage , index ) , defined ( itemWidth ) ) ,
176
- selectedLabelStyle . fontWeight || 'normal' ,
177
- labelStyle . fontWeight || 'normal' ) ;
178
- const letterSpacing = cond ( and ( eq ( targetPage , index ) , defined ( itemWidth ) ) ,
179
- selectedLabelStyle . letterSpacing || 0 ,
180
- labelStyle . letterSpacing || 0 ) ;
181
-
182
194
const inactiveColor = labelColor || DEFAULT_LABEL_COLOR ;
183
195
const activeColor = ! ignore ? selectedLabelColor || DEFAULT_SELECTED_LABEL_COLOR : inactiveColor ;
184
196
185
- // const color = cond(eq(currentPage, index),
186
- // processColor(activeColor),
187
- // processColor(ignore ? activeColor : inactiveColor),);
188
-
189
197
// Animated color
190
198
const color = interpolateColor ( currentPage , {
191
199
inputRange : [ index - 1 , index , index + 1 ] ,
@@ -194,11 +202,12 @@ export default class TabBarItem extends PureComponent {
194
202
195
203
return [
196
204
labelStyle ,
197
- {
205
+ _ . omitBy ( {
206
+ fontFamily,
198
207
fontWeight,
199
208
letterSpacing,
200
209
color
201
- }
210
+ } , _ . isUndefined )
202
211
] ;
203
212
}
204
213
0 commit comments