feat: add headerBackTitleVisible option to navigation options

This commit is contained in:
satyajit.happy
2019-06-14 23:29:10 +02:00
parent 879b0ead57
commit 27c4861c00
2 changed files with 3 additions and 1 deletions

View File

@@ -70,6 +70,7 @@ export type HeaderOptions = {
headerBackAllowFontScaling?: boolean;
headerBackTitle?: string;
headerBackTitleStyle?: StyleProp<TextStyle>;
headerBackTitleVisible?: boolean;
headerTruncatedBackTitle?: string;
headerLeft?: (props: HeaderBackButtonProps) => React.ReactNode;
headerLeftContainerStyle?: StyleProp<ViewStyle>;
@@ -106,7 +107,6 @@ export type NavigationStackOptions = HeaderOptions & {
export type NavigationConfig = TransitionPreset & {
mode: 'card' | 'modal';
headerMode: HeaderMode;
headerBackTitleVisible?: boolean;
cardShadowEnabled?: boolean;
cardOverlayEnabled?: boolean;
transparentCard?: boolean;

View File

@@ -131,6 +131,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
headerRight: right,
headerBackImage: backImage,
headerBackTitle: leftLabel,
headerBackTitleVisible,
headerTruncatedBackTitle: truncatedLabel,
headerPressColorAndroid: pressColorAndroid,
headerBackAllowFontScaling: backAllowFontScaling,
@@ -181,6 +182,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
pressColorAndroid,
allowFontScaling: backAllowFontScaling,
onPress: onGoBack,
labelVisible: headerBackTitleVisible,
label: leftLabel !== undefined ? leftLabel : previousTitle,
truncatedLabel,
labelStyle: [leftLabelStyle, customLeftLabelStyle],