@@ -274,6 +274,24 @@ export default class HeaderSegment extends React.Component<Props, State> {
274
274
}
275
275
}
276
276
277
+ const leftButton = left
278
+ ? left ( {
279
+ backImage,
280
+ pressColorAndroid,
281
+ allowFontScaling : backAllowFontScaling ,
282
+ onPress : onGoBack ,
283
+ labelVisible : headerBackTitleVisible ,
284
+ label : leftLabel !== undefined ? leftLabel : previousTitle ,
285
+ truncatedLabel,
286
+ labelStyle : [ leftLabelStyle , customLeftLabelStyle ] ,
287
+ onLabelLayout : this . handleLeftLabelLayout ,
288
+ screenLayout : layout ,
289
+ titleLayout,
290
+ tintColor : headerTintColor ,
291
+ canGoBack : Boolean ( onGoBack ) ,
292
+ } )
293
+ : null ;
294
+
277
295
return (
278
296
< React . Fragment >
279
297
< Animated . View
@@ -295,34 +313,20 @@ export default class HeaderSegment extends React.Component<Props, State> {
295
313
style = { { height : headerStatusBarHeight } }
296
314
/>
297
315
< View pointerEvents = "box-none" style = { styles . content } >
298
- { left ? (
316
+ { leftButton ? (
299
317
< Animated . View
300
318
pointerEvents = "box-none"
301
319
style = { [ styles . left , leftButtonStyle , leftContainerStyle ] }
302
320
>
303
- { left ( {
304
- backImage,
305
- pressColorAndroid,
306
- allowFontScaling : backAllowFontScaling ,
307
- onPress : onGoBack ,
308
- labelVisible : headerBackTitleVisible ,
309
- label : leftLabel !== undefined ? leftLabel : previousTitle ,
310
- truncatedLabel,
311
- labelStyle : [ leftLabelStyle , customLeftLabelStyle ] ,
312
- onLabelLayout : this . handleLeftLabelLayout ,
313
- screenLayout : layout ,
314
- titleLayout,
315
- tintColor : headerTintColor ,
316
- canGoBack : Boolean ( onGoBack ) ,
317
- } ) }
321
+ { leftButton }
318
322
</ Animated . View >
319
323
) : null }
320
324
< Animated . View
321
325
pointerEvents = "box-none"
322
326
style = { [
323
327
Platform . select ( {
324
328
ios : null ,
325
- default : { left : onGoBack ? 72 : 16 } ,
329
+ default : { left : leftButton ? 72 : 16 } ,
326
330
} ) ,
327
331
styles . title ,
328
332
titleStyle ,
0 commit comments