chore: sync latest stack

This commit is contained in:
Satyajit Sahoo
2020-01-23 12:43:29 +01:00
parent 86dedf12e2
commit 7cfb15e0b7
5 changed files with 132 additions and 67 deletions

View File

@@ -1,6 +1,6 @@
diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx
--- node_modules/@react-navigation/stack/src/index.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/index.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/index.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/index.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -3,11 +3,6 @@
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
@@ -13,7 +13,7 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.t
export const Assets = [
// eslint-disable-next-line import/no-commonjs
require('./views/assets/back-icon.png'),
@@ -48,9 +43,10 @@
@@ -49,9 +44,10 @@
* Types
*/
export {
@@ -28,9 +28,9 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.t
StackHeaderTitleProps,
StackCardInterpolatedStyle,
diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx src/vendor/navigators/createStackNavigator.tsx
--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-09 03:40:24.000000000 +0100
--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100
@@ -1,77 +0,0 @@
@@ -1,81 +0,0 @@
-import * as React from 'react';
-import {
- useNavigationBuilder,
@@ -75,13 +75,17 @@ diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNaviga
- React.useEffect(
- () =>
- navigation.addListener &&
- navigation.addListener('tabPress', (e: EventArg<'tabPress'>) => {
- navigation.addListener('tabPress', e => {
- const isFocused = navigation.isFocused();
-
- // Run the operation in the next frame so we're sure all listeners have been run
- // This is necessary to know if preventDefault() has been called
- requestAnimationFrame(() => {
- if (state.index > 0 && isFocused && !e.defaultPrevented) {
- if (
- state.index > 0 &&
- isFocused &&
- !(e as EventArg<'tabPress', true>).defaultPrevented
- ) {
- // When user taps on already focused tab and we're inside the tab,
- // reset the stack to replicate native behaviour
- navigation.dispatch({
@@ -109,8 +113,8 @@ diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNaviga
- typeof StackNavigator
->(StackNavigator);
diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx
--- node_modules/@react-navigation/stack/src/types.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/types.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/types.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/types.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -8,13 +8,28 @@
} from 'react-native';
import { EdgeInsets } from 'react-native-safe-area-context';
@@ -147,7 +151,7 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t
export type StackNavigationEventMap = {
/**
@@ -27,42 +42,29 @@
transitionEnd: { closing: boolean };
transitionEnd: { data: { closing: boolean } };
};
-export type StackNavigationHelpers = NavigationHelpers<
@@ -255,8 +259,8 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t
export type StackNavigationConfig = {
diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/vendor/views/Header/Header.tsx
--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/Header.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/Header.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,11 +1,13 @@
import * as React from 'react';
-import { StackActions } from '@react-navigation/routers';
@@ -325,8 +329,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/
+
+export default Header;
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx src/vendor/views/Header/HeaderBackButton.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -8,9 +8,9 @@
StyleSheet,
LayoutChangeEvent,
@@ -339,19 +343,19 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButto
type Props = StackHeaderLeftButtonProps;
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx src/vendor/views/Header/HeaderBackground.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Animated, StyleSheet, Platform, ViewProps } from 'react-native';
-import { useTheme } from '@react-navigation/native';
+import useTheme from '../../../utils/useTheme';
export default function HeaderBackground({ style, ...rest }: ViewProps) {
const { colors } = useTheme();
type Props = ViewProps & {
children?: React.ReactNode;
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx src/vendor/views/Header/HeaderContainer.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-09 03:42:01.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,11 +1,7 @@
import * as React from 'react';
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -366,15 +370,15 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer
import { EdgeInsets } from 'react-native-safe-area-context';
import Header from './Header';
@@ -14,6 +10,7 @@
forNoAnimation,
@@ -16,6 +12,7 @@
forSlideRight,
} from '../../TransitionConfigs/HeaderStyleInterpolators';
import {
+ Route,
Layout,
Scene,
StackHeaderStyleInterpolator,
@@ -94,9 +91,7 @@
@@ -99,9 +96,7 @@
insets,
scene,
previous,
@@ -386,8 +390,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer
mode === 'float'
? isHeaderStatic
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx src/vendor/views/Header/HeaderSegment.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -8,7 +8,7 @@
ViewStyle,
} from 'react-native';
@@ -407,8 +411,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.t
};
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx src/vendor/views/Header/HeaderTitle.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Animated, StyleSheet, Platform, TextProps } from 'react-native';
@@ -418,9 +422,9 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx
type Props = TextProps & {
tintColor?: string;
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/vendor/views/Stack/Card.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/Card.tsx 2020-01-09 03:40:42.000000000 +0100
@@ -483,7 +483,7 @@
--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/Card.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -485,7 +485,7 @@
pointerEvents="none"
/>
) : null}
@@ -430,8 +434,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/ven
<CardAnimationContext.Provider value={animationContext}>
{children}
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx src/vendor/views/Stack/CardContainer.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,11 +1,17 @@
import * as React from 'react';
import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -463,8 +467,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.ts
>
<View style={styles.container}>
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx src/vendor/views/Stack/CardStack.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/CardStack.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/CardStack.tsx 2020-01-23 12:44:26.000000000 +0100
@@ -11,8 +11,7 @@
import { EdgeInsets } from 'react-native-safe-area-context';
// eslint-disable-next-line import/no-unresolved
@@ -483,9 +487,18 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx sr
Layout,
StackHeaderMode,
StackCardMode,
@@ -96,7 +96,7 @@
<View
collapsable={!enabled}
removeClippedSubviews={Platform.OS !== 'ios' && enabled}
- style={[style, { overflow: 'hidden' }]}
+ style={[style, { overflow: 'hidden' }] as any}
{...rest}
/>
);
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx src/vendor/views/Stack/StackView.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/StackView.tsx 2020-01-09 03:44:43.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/StackView.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,8 +1,11 @@
import * as React from 'react';
import { Platform } from 'react-native';