Skip to content

Commit

Permalink
fix: pass title style to <HeaderTtitle />. fixes #9885
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 27, 2022
1 parent 97c34bd commit ac98397
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/native-stack/src/views/HeaderConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export default function HeaderConfig({
]);

const titleText = title !== undefined ? title : route.name;
const titleColor =
headerTitleStyleFlattened.color ?? headerTintColor ?? colors.text;

const headerLeftElement = headerLeft?.({ tintColor });
const headerRightElement = headerRight?.({ tintColor });
Expand Down Expand Up @@ -121,9 +123,7 @@ export default function HeaderConfig({
largeTitleFontWeight={headerLargeTitleStyleFlattened.fontWeight}
largeTitleHideShadow={headerLargeTitleShadowVisible === false}
title={typeof headerTitle === 'string' ? headerTitle : titleText}
titleColor={
headerTitleStyleFlattened.color ?? headerTintColor ?? colors.text
}
titleColor={titleColor}
titleFontFamily={titleFontFamily}
titleFontSize={headerTitleStyleFlattened.fontSize}
titleFontWeight={headerTitleStyleFlattened.fontWeight}
Expand Down Expand Up @@ -156,7 +156,9 @@ export default function HeaderConfig({
typeof headerTitle === 'function' ? (
headerTitleElement
) : (
<HeaderTitle tintColor={tintColor}>{titleText}</HeaderTitle>
<HeaderTitle tintColor={tintColor} style={headerTitleStyle}>
{titleText}
</HeaderTitle>
)
) : null}
</View>
Expand All @@ -167,7 +169,9 @@ export default function HeaderConfig({
{typeof headerTitle === 'function' ? (
headerTitleElement
) : (
<HeaderTitle tintColor={tintColor}>{titleText}</HeaderTitle>
<HeaderTitle tintColor={tintColor} style={headerTitleStyle}>
{titleText}
</HeaderTitle>
)}
</ScreenStackHeaderCenterView>
) : null}
Expand Down

0 comments on commit ac98397

Please sign in to comment.