From cfa477710a45bc1aca5c031f8bb0355453b614bb Mon Sep 17 00:00:00 2001 From: Lachlan Date: Wed, 7 Nov 2018 12:22:51 +1000 Subject: [PATCH] React Navigation: headerLayoutPreset && headerBackTitleVisible (#29833) * Update types for stack navigator https://reactnavigation.org/docs/en/stack-navigator.html * unecessary ` * add tests? * What type is this Ref * commit a log * define Ref Types in tests * does not have any construct or call signatures | the methods causing this error arent even used * All tests passing * WIP * add to test * why do I need graphql-tools * diff * wip * cleanup * lol * remove console.log * remove ref Types --- types/react-navigation/index.d.ts | 3 +++ types/react-navigation/react-navigation-tests.tsx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 1572c94e25..846ea56a9e 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -25,6 +25,7 @@ // Denis Frezzato // Mickael Wegerich // Max Davidson +// Lachlan Young // Jason Killian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -374,7 +375,9 @@ export interface NavigationToggleDrawerAction { export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; + headerBackTitleVisible?: boolean; headerTransitionPreset?: 'fade-in-place' | 'uikit'; + headerLayoutPreset?: 'left' | 'center'; cardStyle?: StyleProp; transitionConfig?: ( transitionProps: NavigationTransitionProps, diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 1b6bff2586..e568fbed27 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -125,6 +125,7 @@ const initialRouteParams: StartScreenNavigationParams = { id: 1, s: "Start", }; + const routeConfigMap: NavigationRouteConfigMap = { [ROUTE_NAME_START_SCREEN]: { path: "start", @@ -140,6 +141,7 @@ export const AppNavigator = createStackNavigator( { initialRouteName: ROUTE_NAME_START_SCREEN, initialRouteKey: ROUTE_KEY_START_SCREEN, + headerLayoutPreset: 'center', initialRouteParams, navigationOptions, }, @@ -614,7 +616,6 @@ createStackNavigator( ); // Test NavigationEvents component - const ViewWithNavigationEvents = (