fix: fix header tint color not applied

This commit is contained in:
satyajit.happy
2019-06-14 23:23:45 +02:00
parent e8a1b5f03f
commit 879b0ead57
2 changed files with 5 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ export type HeaderOptions = {
headerTruncatedBackTitle?: string;
headerLeft?: (props: HeaderBackButtonProps) => React.ReactNode;
headerLeftContainerStyle?: StyleProp<ViewStyle>;
headerRight?: () => React.ReactNode;
headerRight?: (props: { tintColor?: string }) => React.ReactNode;
headerRightContainerStyle?: StyleProp<ViewStyle>;
headerBackImage?: HeaderBackButtonProps['backImage'];
headerPressColorAndroid?: string;

View File

@@ -125,6 +125,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
<HeaderBackButton {...props} />
),
headerBackground,
headerTintColor,
// @ts-ignore
headerStatusBarHeight = getStatusBarHeight(layout.width > layout.height),
headerRight: right,
@@ -186,6 +187,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
onLabelLayout: this.handleLeftLabelLayout,
screenLayout: layout,
titleLayout,
tintColor: headerTintColor,
})}
</Animated.View>
) : null}
@@ -204,7 +206,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
<HeaderTitle
onLayout={this.handleTitleLayout}
allowFontScaling={titleAllowFontScaling}
style={customTitleStyle}
style={[{ color: headerTintColor }, customTitleStyle]}
>
{currentTitle}
</HeaderTitle>
@@ -214,7 +216,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
<Animated.View
style={[styles.right, rightButtonStyle, rightContainerStyle]}
>
{right()}
{right({ tintColor: headerTintColor })}
</Animated.View>
) : null}
</View>