From 127e030e03cfec9600cca0327edd159a7bb08896 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 1 Sep 2021 12:45:05 +0200 Subject: [PATCH] fix: pass title style to . fixes #9885 --- packages/native-stack/src/views/HeaderConfig.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/native-stack/src/views/HeaderConfig.tsx b/packages/native-stack/src/views/HeaderConfig.tsx index 51dbd53fd8..b05db9ffb9 100644 --- a/packages/native-stack/src/views/HeaderConfig.tsx +++ b/packages/native-stack/src/views/HeaderConfig.tsx @@ -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 }); @@ -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} @@ -156,7 +156,9 @@ export default function HeaderConfig({ typeof headerTitle === 'function' ? ( headerTitleElement ) : ( - {titleText} + + {titleText} + ) ) : null} @@ -167,7 +169,9 @@ export default function HeaderConfig({ {typeof headerTitle === 'function' ? ( headerTitleElement ) : ( - {titleText} + + {titleText} + )} ) : null}