|
8 | 8 | } from 'react-native'; |
9 | 9 | import Animated from 'react-native-reanimated'; |
10 | 10 | import { SafeAreaContext, EdgeInsets } from 'react-native-safe-area-context'; |
| 11 | +import HeaderTitle from './HeaderTitle'; |
11 | 12 | import HeaderBackButton from './HeaderBackButton'; |
12 | 13 | import HeaderBackground from './HeaderBackground'; |
13 | 14 | import memoize from '../../utils/memoize'; |
@@ -358,14 +359,22 @@ export default class HeaderSegment extends React.Component<Props, State> { |
358 | 359 | titleContainerStyle, |
359 | 360 | ]} |
360 | 361 | > |
361 | | - {typeof headerTitle === 'function' |
362 | | - ? headerTitle({ |
363 | | - children: currentTitle, |
364 | | - onLayout: this.handleTitleLayout, |
365 | | - allowFontScaling: titleAllowFontScaling, |
366 | | - style: [{ color: headerTintColor }, customTitleStyle], |
367 | | - }) |
368 | | - : headerTitle} |
| 362 | + {typeof headerTitle === 'function' ? ( |
| 363 | + headerTitle({ |
| 364 | + children: currentTitle, |
| 365 | + onLayout: this.handleTitleLayout, |
| 366 | + allowFontScaling: titleAllowFontScaling, |
| 367 | + style: [{ color: headerTintColor }, customTitleStyle], |
| 368 | + }) |
| 369 | + ) : ( |
| 370 | + <HeaderTitle |
| 371 | + onLayout={this.handleTitleLayout} |
| 372 | + allowFontScaling={titleAllowFontScaling} |
| 373 | + style={[{ color: headerTintColor }, customTitleStyle]} |
| 374 | + > |
| 375 | + {currentTitle} |
| 376 | + </HeaderTitle> |
| 377 | + )} |
369 | 378 | </Animated.View> |
370 | 379 | {right !== undefined ? ( |
371 | 380 | <Animated.View |
|
0 commit comments