fix: fix header tint color not applied

This commit is contained in:
satyajit.happy
2019-06-14 23:23:45 +02:00
parent 60b4b94479
commit 1b2dcd77d4
4 changed files with 29 additions and 7 deletions

View File

@@ -463,7 +463,12 @@ Array [
"fontSize": 17,
"fontWeight": "600",
},
undefined,
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>
@@ -589,7 +594,12 @@ Array [
"fontSize": 17,
"fontWeight": "600",
},
undefined,
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>

View File

@@ -297,7 +297,12 @@ Array [
"fontSize": 17,
"fontWeight": "600",
},
undefined,
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>
@@ -627,7 +632,12 @@ Array [
"fontSize": 17,
"fontWeight": "600",
},
undefined,
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>

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>