mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-29 22:53:52 +08:00
Compare commits
3 Commits
react-navi
...
react-navi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f34ec46111 | ||
|
|
8b79e9bee6 | ||
|
|
e09906a423 |
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.5.12](https://github.com/react-navigation/react-navigation/compare/react-navigation-animated-switch@0.5.11...react-navigation-animated-switch@0.5.12) (2020-04-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package react-navigation-animated-switch
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.5.11](https://github.com/react-navigation/react-navigation/compare/react-navigation-animated-switch@0.5.10...react-navigation-animated-switch@0.5.11) (2020-04-22)
|
## [0.5.11](https://github.com/react-navigation/react-navigation/compare/react-navigation-animated-switch@0.5.10...react-navigation-animated-switch@0.5.11) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package react-navigation-animated-switch
|
**Note:** Version bump only for package react-navigation-animated-switch
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation-animated-switch",
|
"name": "react-navigation-animated-switch",
|
||||||
"version": "0.5.11",
|
"version": "0.5.12",
|
||||||
"description": "Animated switch for React Navigation",
|
"description": "Animated switch for React Navigation",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "lib/module/index.js",
|
"react-native": "lib/module/index.js",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"react": "~16.9.0",
|
"react": "~16.9.0",
|
||||||
"react-native": "~0.61.5",
|
"react-native": "~0.61.5",
|
||||||
"react-native-reanimated": "~1.7.0",
|
"react-native-reanimated": "~1.7.0",
|
||||||
"react-navigation": "^4.3.8",
|
"react-navigation": "^4.3.9",
|
||||||
"typescript": "~3.8.3"
|
"typescript": "~3.8.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [3.7.6](https://github.com/react-navigation/react-navigation-core/compare/@react-navigation/core@3.7.5...@react-navigation/core@3.7.6) (2020-04-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* change old docUrl to new docUrl due v5 ([e09906a](https://github.com/react-navigation/react-navigation-core/commit/e09906a4235a0fca09140923ebe7af34b50b491a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [3.7.5](https://github.com/react-navigation/react-navigation-core/compare/@react-navigation/core@3.7.4...@react-navigation/core@3.7.5) (2020-04-02)
|
## [3.7.5](https://github.com/react-navigation/react-navigation-core/compare/@react-navigation/core@3.7.4...@react-navigation/core@3.7.5) (2020-04-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@react-navigation/core",
|
"name": "@react-navigation/core",
|
||||||
"version": "3.7.5",
|
"version": "3.7.6",
|
||||||
"description": "Core utilities for the react-navigation framework",
|
"description": "Core utilities for the react-navigation framework",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "lib/module/index.js",
|
"react-native": "lib/module/index.js",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default function docsUrl(path: string) {
|
export default function docsUrl(path: string) {
|
||||||
return `https://reactnavigation.org/docs/${path}`;
|
return `https://reactnavigation.org/docs/4.x/${path}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.4.13](https://github.com/react-navigation/drawer/compare/react-navigation-drawer@2.4.12...react-navigation-drawer@2.4.13) (2020-04-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package react-navigation-drawer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.4.12](https://github.com/react-navigation/drawer/compare/react-navigation-drawer@2.4.11...react-navigation-drawer@2.4.12) (2020-04-22)
|
## [2.4.12](https://github.com/react-navigation/drawer/compare/react-navigation-drawer@2.4.11...react-navigation-drawer@2.4.12) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package react-navigation-drawer
|
**Note:** Version bump only for package react-navigation-drawer
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation-drawer",
|
"name": "react-navigation-drawer",
|
||||||
"version": "2.4.12",
|
"version": "2.4.13",
|
||||||
"description": "Drawer navigator component for React Navigation",
|
"description": "Drawer navigator component for React Navigation",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "lib/module/index.js",
|
"react-native": "lib/module/index.js",
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"react-native-reanimated": "^1.2.0",
|
"react-native-reanimated": "^1.2.0",
|
||||||
"react-native-screens": "^2.3.0",
|
"react-native-screens": "^2.3.0",
|
||||||
"react-native-testing-library": "^1.12.0",
|
"react-native-testing-library": "^1.12.0",
|
||||||
"react-navigation": "^4.3.8",
|
"react-navigation": "^4.3.9",
|
||||||
"typescript": "~3.8.3"
|
"typescript": "~3.8.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.2.12](https://github.com/react-navigation/react-navigation-material-bottom-tabs/compare/react-navigation-material-bottom-tabs@2.2.11...react-navigation-material-bottom-tabs@2.2.12) (2020-04-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package react-navigation-material-bottom-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.2.11](https://github.com/react-navigation/react-navigation-material-bottom-tabs/compare/react-navigation-material-bottom-tabs@2.2.10...react-navigation-material-bottom-tabs@2.2.11) (2020-04-22)
|
## [2.2.11](https://github.com/react-navigation/react-navigation-material-bottom-tabs/compare/react-navigation-material-bottom-tabs@2.2.10...react-navigation-material-bottom-tabs@2.2.11) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package react-navigation-material-bottom-tabs
|
**Note:** Version bump only for package react-navigation-material-bottom-tabs
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation-material-bottom-tabs",
|
"name": "react-navigation-material-bottom-tabs",
|
||||||
"version": "2.2.11",
|
"version": "2.2.12",
|
||||||
"description": "Material Bottom Tab Navigation component for React Navigation",
|
"description": "Material Bottom Tab Navigation component for React Navigation",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"module": "lib/module/index.js",
|
"module": "lib/module/index.js",
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
"react-native-gesture-handler": "^1.6.0",
|
"react-native-gesture-handler": "^1.6.0",
|
||||||
"react-native-paper": "^3.1.1",
|
"react-native-paper": "^3.1.1",
|
||||||
"react-native-reanimated": "^1.2.0",
|
"react-native-reanimated": "^1.2.0",
|
||||||
"react-navigation": "^4.3.8",
|
"react-navigation": "^4.3.9",
|
||||||
"typescript": "~3.8.3"
|
"typescript": "~3.8.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [3.7.13](https://github.com/react-navigation/react-navigation-native/compare/@react-navigation/native@3.7.12...@react-navigation/native@3.7.13) (2020-04-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @react-navigation/native
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [3.7.12](https://github.com/react-navigation/react-navigation-native/compare/@react-navigation/native@3.7.11...@react-navigation/native@3.7.12) (2020-04-22)
|
## [3.7.12](https://github.com/react-navigation/react-navigation-native/compare/@react-navigation/native@3.7.11...@react-navigation/native@3.7.12) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package @react-navigation/native
|
**Note:** Version bump only for package @react-navigation/native
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@react-navigation/native",
|
"name": "@react-navigation/native",
|
||||||
"version": "3.7.12",
|
"version": "3.7.13",
|
||||||
"description": "React Native support for React Navigation",
|
"description": "React Native support for React Navigation",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"react-native": "lib/module/index.js",
|
"react-native": "lib/module/index.js",
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.10.0",
|
"@react-native-community/bob": "^0.10.0",
|
||||||
"@react-navigation/core": "^3.7.5",
|
"@react-navigation/core": "^3.7.6",
|
||||||
"@types/react-test-renderer": "^16.9.2",
|
"@types/react-test-renderer": "^16.9.2",
|
||||||
"del-cli": "^3.0.0",
|
"del-cli": "^3.0.0",
|
||||||
"react": "~16.9.0",
|
"react": "~16.9.0",
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [4.3.9](https://github.com/react-navigation/react-navigation/compare/react-navigation@4.3.8...react-navigation@4.3.9) (2020-04-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* change old docUrl to new docUrl due v5 ([e09906a](https://github.com/react-navigation/react-navigation/commit/e09906a4235a0fca09140923ebe7af34b50b491a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [4.3.8](https://github.com/react-navigation/react-navigation/compare/react-navigation@4.3.7...react-navigation@4.3.8) (2020-04-22)
|
## [4.3.8](https://github.com/react-navigation/react-navigation/compare/react-navigation@4.3.7...react-navigation@4.3.8) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package react-navigation
|
**Note:** Version bump only for package react-navigation
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation",
|
"name": "react-navigation",
|
||||||
"version": "4.3.8",
|
"version": "4.3.9",
|
||||||
"description": "Routing and navigation for your React Native apps",
|
"description": "Routing and navigation for your React Native apps",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "typescript/react-navigation.d.ts",
|
"types": "typescript/react-navigation.d.ts",
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
"react-native": "*"
|
"react-native": "*"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-navigation/core": "^3.7.5",
|
"@react-navigation/core": "^3.7.6",
|
||||||
"@react-navigation/native": "^3.7.12"
|
"@react-navigation/native": "^3.7.13"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^16.9.23",
|
"@types/react": "^16.9.23",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default function docsUrl(path) {
|
export default function docsUrl(path) {
|
||||||
return `https://reactnavigation.org/docs/${path}`;
|
return `https://reactnavigation.org/docs/4.x/${path}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [2.4.0](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.13...react-navigation-stack@2.4.0) (2020-04-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* sync latest stack ([8b79e9b](https://github.com/react-navigation/react-navigation-stack/commit/8b79e9bee65c3ba6a788ca76771379319168f117))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.3.13](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.12...react-navigation-stack@2.3.13) (2020-04-22)
|
## [2.3.13](https://github.com/react-navigation/react-navigation-stack/compare/react-navigation-stack@2.3.12...react-navigation-stack@2.3.13) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package react-navigation-stack
|
**Note:** Version bump only for package react-navigation-stack
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation-stack",
|
"name": "react-navigation-stack",
|
||||||
"version": "2.3.13",
|
"version": "2.4.0",
|
||||||
"description": "Stack navigator component for React Navigation",
|
"description": "Stack navigator component for React Navigation",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"module": "lib/module/index.js",
|
"module": "lib/module/index.js",
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@react-native-community/bob": "^0.10.0",
|
"@react-native-community/bob": "^0.10.0",
|
||||||
"@react-native-community/masked-view": "^0.1.7",
|
"@react-native-community/masked-view": "^0.1.7",
|
||||||
"@react-navigation/stack": "^5.2.12",
|
"@react-navigation/stack": "^5.2.16",
|
||||||
"@types/color": "^3.0.1",
|
"@types/color": "^3.0.1",
|
||||||
"@types/react": "^16.9.23",
|
"@types/react": "^16.9.23",
|
||||||
"@types/react-native": "^0.61.22",
|
"@types/react-native": "^0.61.22",
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
"react-native-gesture-handler": "^1.6.0",
|
"react-native-gesture-handler": "^1.6.0",
|
||||||
"react-native-safe-area-context": "^0.7.3",
|
"react-native-safe-area-context": "^0.7.3",
|
||||||
"react-native-screens": "^2.3.0",
|
"react-native-screens": "^2.3.0",
|
||||||
"react-navigation": "^4.3.8",
|
"react-navigation": "^4.3.9",
|
||||||
"react-test-renderer": "~16.9.0",
|
"react-test-renderer": "~16.9.0",
|
||||||
"typescript": "~3.8.3"
|
"typescript": "~3.8.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx
|
diff -Naur ../../node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx
|
||||||
--- ../../node_modules/@react-navigation/stack/src/index.tsx 2020-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/index.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/index.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/index.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -3,11 +3,6 @@
|
@@ -3,11 +3,6 @@
|
||||||
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
|
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
|
||||||
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
|
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
|
||||||
@@ -27,7 +27,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/index.tsx src/vendor/i
|
|||||||
StackHeaderLeftButtonProps,
|
StackHeaderLeftButtonProps,
|
||||||
StackHeaderTitleProps,
|
StackHeaderTitleProps,
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx src/vendor/navigators/createStackNavigator.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100
|
+++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100
|
||||||
@@ -1,96 +0,0 @@
|
@@ -1,96 +0,0 @@
|
||||||
-import * as React from 'react';
|
-import * as React from 'react';
|
||||||
@@ -127,8 +127,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/navigators/createStack
|
|||||||
- typeof StackNavigator
|
- typeof StackNavigator
|
||||||
->(StackNavigator);
|
->(StackNavigator);
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx
|
diff -Naur ../../node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx
|
||||||
--- ../../node_modules/@react-navigation/stack/src/types.tsx 2020-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/types.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/types.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/types.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -8,14 +8,28 @@
|
@@ -8,14 +8,28 @@
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { EdgeInsets } from 'react-native-safe-area-context';
|
import { EdgeInsets } from 'react-native-safe-area-context';
|
||||||
@@ -244,7 +244,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/types.tsx src/vendor/t
|
|||||||
export type StackNavigationOptions = StackHeaderOptions &
|
export type StackNavigationOptions = StackHeaderOptions &
|
||||||
Partial<TransitionPreset> & {
|
Partial<TransitionPreset> & {
|
||||||
/**
|
/**
|
||||||
@@ -317,6 +341,8 @@
|
@@ -320,6 +344,8 @@
|
||||||
bottom?: number;
|
bottom?: number;
|
||||||
left?: number;
|
left?: number;
|
||||||
};
|
};
|
||||||
@@ -254,8 +254,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/types.tsx src/vendor/t
|
|||||||
|
|
||||||
export type StackNavigationConfig = {
|
export type StackNavigationConfig = {
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/vendor/views/Header/Header.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Header/Header.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Header/Header.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -1,12 +1,14 @@
|
@@ -1,12 +1,14 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
-import { StackActions } from '@react-navigation/native';
|
-import { StackActions } from '@react-navigation/native';
|
||||||
@@ -335,22 +335,22 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/Header.ts
|
|||||||
+
|
+
|
||||||
+export default Header;
|
+export default Header;
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx src/vendor/views/Header/HeaderBackButton.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-05-01 01:33:40.000000000 +0200
|
||||||
@@ -8,9 +8,9 @@
|
@@ -8,9 +8,9 @@
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
LayoutChangeEvent,
|
LayoutChangeEvent,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
-import { useTheme } from '@react-navigation/native';
|
-import { useTheme } from '@react-navigation/native';
|
||||||
import MaskedView from '../MaskedView';
|
import MaskedView from '../MaskedView';
|
||||||
import TouchableItem from '../TouchableItem';
|
import { TouchableItem } from '../TouchableItem';
|
||||||
+import useTheme from '../../../utils/useTheme';
|
+import useTheme from '../../../utils/useTheme';
|
||||||
import { StackHeaderLeftButtonProps } from '../../types';
|
import { StackHeaderLeftButtonProps } from '../../types';
|
||||||
|
|
||||||
type Props = StackHeaderLeftButtonProps;
|
type Props = StackHeaderLeftButtonProps;
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx src/vendor/views/Header/HeaderBackground.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -1,6 +1,6 @@
|
@@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Animated, StyleSheet, Platform, ViewProps } from 'react-native';
|
import { Animated, StyleSheet, Platform, ViewProps } from 'react-native';
|
||||||
@@ -360,8 +360,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderBac
|
|||||||
type Props = ViewProps & {
|
type Props = ViewProps & {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx src/vendor/views/Header/HeaderContainer.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -1,11 +1,6 @@
|
@@ -1,11 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
|
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
|
||||||
@@ -413,8 +413,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderCon
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx src/vendor/views/Header/HeaderSegment.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -8,7 +8,7 @@
|
@@ -8,7 +8,7 @@
|
||||||
ViewStyle,
|
ViewStyle,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
@@ -434,8 +434,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderSeg
|
|||||||
};
|
};
|
||||||
|
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx src/vendor/views/Header/HeaderTitle.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -1,6 +1,6 @@
|
@@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Animated, StyleSheet, Platform } from 'react-native';
|
import { Animated, StyleSheet, Platform } from 'react-native';
|
||||||
@@ -445,9 +445,9 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Header/HeaderTit
|
|||||||
type Props = React.ComponentProps<typeof Animated.Text> & {
|
type Props = React.ComponentProps<typeof Animated.Text> & {
|
||||||
tintColor?: string;
|
tintColor?: string;
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/vendor/views/Stack/Card.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Stack/Card.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Stack/Card.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -138,7 +138,7 @@
|
@@ -140,7 +140,7 @@
|
||||||
|
|
||||||
private interactionHandle: number | undefined;
|
private interactionHandle: number | undefined;
|
||||||
|
|
||||||
@@ -457,28 +457,26 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/Card.tsx s
|
|||||||
private animate = ({
|
private animate = ({
|
||||||
closing,
|
closing,
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx src/vendor/views/Stack/CardContainer.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Stack/CardContainer.tsx 2020-04-22 16:34:39.000000000 +0200
|
+++ src/vendor/views/Stack/CardContainer.tsx 2020-05-01 01:34:25.000000000 +0200
|
||||||
@@ -1,10 +1,16 @@
|
@@ -1,14 +1,14 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
|
import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
|
||||||
-import { Route, useTheme } from '@react-navigation/native';
|
-import { Route, useTheme } from '@react-navigation/native';
|
||||||
import { Props as HeaderContainerProps } from '../Header/HeaderContainer';
|
import { Props as HeaderContainerProps } from '../Header/HeaderContainer';
|
||||||
import Card from './Card';
|
import Card from './Card';
|
||||||
import HeaderHeightContext from '../../utils/HeaderHeightContext';
|
import HeaderHeightContext from '../../utils/HeaderHeightContext';
|
||||||
-import { Scene, Layout, StackHeaderMode, TransitionPreset } from '../../types';
|
|
||||||
+import useTheme from '../../../utils/useTheme';
|
+import useTheme from '../../../utils/useTheme';
|
||||||
+import {
|
import {
|
||||||
+ Route,
|
+ Route,
|
||||||
+ Scene,
|
Scene,
|
||||||
+ Layout,
|
Layout,
|
||||||
+ StackHeaderMode,
|
StackHeaderMode,
|
||||||
+ TransitionPreset,
|
- StackCardMode,
|
||||||
+} from '../../types';
|
TransitionPreset,
|
||||||
|
} from '../../types';
|
||||||
|
|
||||||
type Props = TransitionPreset & {
|
@@ -192,7 +192,7 @@
|
||||||
index: number;
|
|
||||||
@@ -183,7 +189,7 @@
|
|
||||||
? { marginTop: headerHeight }
|
? { marginTop: headerHeight }
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
@@ -488,8 +486,8 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardContai
|
|||||||
>
|
>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx src/vendor/views/Stack/CardStack.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Stack/CardStack.tsx 2020-04-22 16:35:12.000000000 +0200
|
+++ src/vendor/views/Stack/CardStack.tsx 2020-05-01 01:32:40.000000000 +0200
|
||||||
@@ -7,7 +7,7 @@
|
@@ -7,7 +7,7 @@
|
||||||
Platform,
|
Platform,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
@@ -508,11 +506,11 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/CardStack.
|
|||||||
StackHeaderMode,
|
StackHeaderMode,
|
||||||
StackCardMode,
|
StackCardMode,
|
||||||
diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx src/vendor/views/Stack/StackView.tsx
|
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-04-22 16:34:01.000000000 +0200
|
--- ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-05-01 01:29:42.000000000 +0200
|
||||||
+++ src/vendor/views/Stack/StackView.tsx 2020-04-22 16:38:12.000000000 +0200
|
+++ src/vendor/views/Stack/StackView.tsx 2020-05-01 01:37:12.000000000 +0200
|
||||||
@@ -4,9 +4,10 @@
|
@@ -4,9 +4,10 @@
|
||||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
||||||
import {
|
import {
|
||||||
|
NavigationHelpersContext,
|
||||||
StackActions,
|
StackActions,
|
||||||
- StackNavigationState,
|
- StackNavigationState,
|
||||||
- Route,
|
- Route,
|
||||||
@@ -522,9 +520,9 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
+ SceneView,
|
+ SceneView,
|
||||||
+} from 'react-navigation';
|
+} from 'react-navigation';
|
||||||
|
|
||||||
|
import { GestureHandlerRootView } from '../GestureHandler';
|
||||||
import CardStack from './CardStack';
|
import CardStack from './CardStack';
|
||||||
import KeyboardManager from '../KeyboardManager';
|
@@ -16,6 +17,7 @@
|
||||||
@@ -15,6 +16,7 @@
|
|
||||||
} from '../Header/HeaderContainer';
|
} from '../Header/HeaderContainer';
|
||||||
import SafeAreaProviderCompat from '../SafeAreaProviderCompat';
|
import SafeAreaProviderCompat from '../SafeAreaProviderCompat';
|
||||||
import {
|
import {
|
||||||
@@ -532,7 +530,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
StackNavigationHelpers,
|
StackNavigationHelpers,
|
||||||
StackNavigationConfig,
|
StackNavigationConfig,
|
||||||
StackDescriptorMap,
|
StackDescriptorMap,
|
||||||
@@ -24,6 +26,7 @@
|
@@ -25,6 +27,7 @@
|
||||||
state: StackNavigationState;
|
state: StackNavigationState;
|
||||||
navigation: StackNavigationHelpers;
|
navigation: StackNavigationHelpers;
|
||||||
descriptors: StackDescriptorMap;
|
descriptors: StackDescriptorMap;
|
||||||
@@ -540,7 +538,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
@@ -292,7 +295,9 @@
|
@@ -293,7 +296,9 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,7 +549,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -320,23 +325,44 @@
|
@@ -321,24 +326,47 @@
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,13 +586,13 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
private handleOpenRoute = ({ route }: { route: Route<string> }) => {
|
private handleOpenRoute = ({ route }: { route: Route<string> }) => {
|
||||||
const { state, navigation } = this.props;
|
const { state, navigation } = this.props;
|
||||||
|
|
||||||
- if (
|
|
||||||
- state.routeNames.includes(route.name) &&
|
|
||||||
- !state.routes.some((r) => r.key === route.key)
|
|
||||||
- ) {
|
|
||||||
+ this.handleTransitionComplete();
|
+ this.handleTransitionComplete();
|
||||||
+
|
+
|
||||||
+ if (!state.routes.some((r) => r.key === route.key)) {
|
if (
|
||||||
|
this.state.replacingRouteKeys.every((key) => key !== route.key) &&
|
||||||
|
- state.routeNames.includes(route.name) &&
|
||||||
|
!state.routes.some((r) => r.key === route.key)
|
||||||
|
) {
|
||||||
// If route isn't present in current state, assume that a close animation was cancelled
|
// If route isn't present in current state, assume that a close animation was cancelled
|
||||||
// So we need to add this route back to the state
|
// So we need to add this route back to the state
|
||||||
- navigation.navigate(route);
|
- navigation.navigate(route);
|
||||||
@@ -602,7 +600,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
} else {
|
} else {
|
||||||
this.setState((state) => ({
|
this.setState((state) => ({
|
||||||
routes: state.replacingRouteKeys.length
|
routes: state.replacingRouteKeys.length
|
||||||
@@ -362,12 +388,11 @@
|
@@ -364,12 +392,11 @@
|
||||||
// If a route exists in state, trigger a pop
|
// If a route exists in state, trigger a pop
|
||||||
// This will happen in when the route was closed from the card component
|
// This will happen in when the route was closed from the card component
|
||||||
// e.g. When the close animation triggered from a gesture ends
|
// e.g. When the close animation triggered from a gesture ends
|
||||||
@@ -619,7 +617,7 @@ diff -Naur ../../node_modules/@react-navigation/stack/src/views/Stack/StackView.
|
|||||||
// We need to clean up any state tracking the route and pop it immediately
|
// We need to clean up any state tracking the route and pop it immediately
|
||||||
this.setState((state) => ({
|
this.setState((state) => ({
|
||||||
routes: state.routes.filter((r) => r.key !== route.key),
|
routes: state.routes.filter((r) => r.key !== route.key),
|
||||||
@@ -384,22 +409,24 @@
|
@@ -386,22 +413,24 @@
|
||||||
private handleTransitionStart = (
|
private handleTransitionStart = (
|
||||||
{ route }: { route: Route<string> },
|
{ route }: { route: Route<string> },
|
||||||
closing: boolean
|
closing: boolean
|
||||||
|
|||||||
9
packages/stack/src/vendor/types.tsx
vendored
9
packages/stack/src/vendor/types.tsx
vendored
@@ -300,7 +300,8 @@ export type StackNavigationOptions = StackHeaderOptions &
|
|||||||
cardStyle?: StyleProp<ViewStyle>;
|
cardStyle?: StyleProp<ViewStyle>;
|
||||||
/**
|
/**
|
||||||
* Whether transition animation should be enabled the screen.
|
* Whether transition animation should be enabled the screen.
|
||||||
* If you set it to `false`, the screen won't animate when pushing or popping. Defaults to `true`.
|
* If you set it to `false`, the screen won't animate when pushing or popping.
|
||||||
|
* Defaults to `true` on Android and iOS, `false` on Web.
|
||||||
*/
|
*/
|
||||||
animationEnabled?: boolean;
|
animationEnabled?: boolean;
|
||||||
/**
|
/**
|
||||||
@@ -310,10 +311,12 @@ export type StackNavigationOptions = StackHeaderOptions &
|
|||||||
animationTypeForReplace?: 'push' | 'pop';
|
animationTypeForReplace?: 'push' | 'pop';
|
||||||
/**
|
/**
|
||||||
* Whether you can use gestures to dismiss this screen. Defaults to `true` on iOS, `false` on Android.
|
* Whether you can use gestures to dismiss this screen. Defaults to `true` on iOS, `false` on Android.
|
||||||
|
* Not supported on Web.
|
||||||
*/
|
*/
|
||||||
gestureEnabled?: boolean;
|
gestureEnabled?: boolean;
|
||||||
/**
|
/**
|
||||||
* Object to override the distance of touch start from the edge of the screen to recognize gestures.
|
* Object to override the distance of touch start from the edge of the screen to recognize gestures.
|
||||||
|
* Not supported on Web.
|
||||||
*/
|
*/
|
||||||
gestureResponseDistance?: {
|
gestureResponseDistance?: {
|
||||||
/**
|
/**
|
||||||
@@ -326,8 +329,8 @@ export type StackNavigationOptions = StackHeaderOptions &
|
|||||||
horizontal?: number;
|
horizontal?: number;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Number which determines the relevance of velocity for the gesture.
|
* Number which determines the relevance of velocity for the gesture. Defaults to 0.3.
|
||||||
* Defaults to 0.3.
|
* Not supported on Web.
|
||||||
*/
|
*/
|
||||||
gestureVelocityImpact?: number;
|
gestureVelocityImpact?: number;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { PanGestureHandler } from 'react-native-gesture-handler';
|
|
||||||
|
|
||||||
export default React.createContext<React.Ref<PanGestureHandler> | undefined>(
|
export default React.createContext<React.Ref<
|
||||||
undefined
|
import('react-native-gesture-handler').PanGestureHandler
|
||||||
);
|
> | null>(null);
|
||||||
|
|||||||
22
packages/stack/src/vendor/views/GestureHandler.native.tsx
vendored
Normal file
22
packages/stack/src/vendor/views/GestureHandler.native.tsx
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import {
|
||||||
|
PanGestureHandler as PanGestureHandlerNative,
|
||||||
|
PanGestureHandlerProperties,
|
||||||
|
} from 'react-native-gesture-handler';
|
||||||
|
import GestureHandlerRefContext from '../utils/GestureHandlerRefContext';
|
||||||
|
|
||||||
|
export function PanGestureHandler(props: PanGestureHandlerProperties) {
|
||||||
|
const gestureRef = React.useRef<PanGestureHandlerNative>(null);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<GestureHandlerRefContext.Provider value={gestureRef}>
|
||||||
|
<PanGestureHandlerNative {...props} />
|
||||||
|
</GestureHandlerRefContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
GestureHandlerRootView,
|
||||||
|
State as GestureState,
|
||||||
|
PanGestureHandlerGestureEvent,
|
||||||
|
} from 'react-native-gesture-handler';
|
||||||
24
packages/stack/src/vendor/views/GestureHandler.tsx
vendored
Normal file
24
packages/stack/src/vendor/views/GestureHandler.tsx
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import { View } from 'react-native';
|
||||||
|
import type { PanGestureHandlerProperties } from 'react-native-gesture-handler';
|
||||||
|
|
||||||
|
const Dummy: any = ({ children }: { children: React.ReactNode }) => (
|
||||||
|
<>{children}</>
|
||||||
|
);
|
||||||
|
|
||||||
|
export const PanGestureHandler = Dummy as React.ComponentType<
|
||||||
|
PanGestureHandlerProperties
|
||||||
|
>;
|
||||||
|
|
||||||
|
export const GestureHandlerRootView = View;
|
||||||
|
|
||||||
|
export const GestureState = {
|
||||||
|
UNDETERMINED: 0,
|
||||||
|
FAILED: 1,
|
||||||
|
BEGAN: 2,
|
||||||
|
CANCELLED: 3,
|
||||||
|
ACTIVE: 4,
|
||||||
|
END: 5,
|
||||||
|
};
|
||||||
|
|
||||||
|
export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
LayoutChangeEvent,
|
LayoutChangeEvent,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import MaskedView from '../MaskedView';
|
import MaskedView from '../MaskedView';
|
||||||
import TouchableItem from '../TouchableItem';
|
import { TouchableItem } from '../TouchableItem';
|
||||||
import useTheme from '../../../utils/useTheme';
|
import useTheme from '../../../utils/useTheme';
|
||||||
import { StackHeaderLeftButtonProps } from '../../types';
|
import { StackHeaderLeftButtonProps } from '../../types';
|
||||||
|
|
||||||
|
|||||||
34
packages/stack/src/vendor/views/Stack/Card.tsx
vendored
34
packages/stack/src/vendor/views/Stack/Card.tsx
vendored
@@ -9,14 +9,15 @@ import {
|
|||||||
Platform,
|
Platform,
|
||||||
InteractionManager,
|
InteractionManager,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {
|
|
||||||
PanGestureHandler,
|
|
||||||
State as GestureState,
|
|
||||||
PanGestureHandlerGestureEvent,
|
|
||||||
} from 'react-native-gesture-handler';
|
|
||||||
import { EdgeInsets } from 'react-native-safe-area-context';
|
import { EdgeInsets } from 'react-native-safe-area-context';
|
||||||
import Color from 'color';
|
import Color from 'color';
|
||||||
import StackGestureRefContext from '../../utils/GestureHandlerRefContext';
|
|
||||||
|
import CardSheet from './CardSheet';
|
||||||
|
import {
|
||||||
|
PanGestureHandler,
|
||||||
|
GestureState,
|
||||||
|
PanGestureHandlerGestureEvent,
|
||||||
|
} from '../GestureHandler';
|
||||||
import CardAnimationContext from '../../utils/CardAnimationContext';
|
import CardAnimationContext from '../../utils/CardAnimationContext';
|
||||||
import getDistanceForDirection from '../../utils/getDistanceForDirection';
|
import getDistanceForDirection from '../../utils/getDistanceForDirection';
|
||||||
import getInvertedMultiplier from '../../utils/getInvertedMultiplier';
|
import getInvertedMultiplier from '../../utils/getInvertedMultiplier';
|
||||||
@@ -36,6 +37,7 @@ type Props = ViewProps & {
|
|||||||
gesture: Animated.Value;
|
gesture: Animated.Value;
|
||||||
layout: Layout;
|
layout: Layout;
|
||||||
insets: EdgeInsets;
|
insets: EdgeInsets;
|
||||||
|
pageOverflowEnabled: boolean;
|
||||||
gestureDirection: GestureDirection;
|
gestureDirection: GestureDirection;
|
||||||
onOpen: () => void;
|
onOpen: () => void;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
@@ -412,8 +414,6 @@ export default class Card extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private gestureRef = React.createRef<PanGestureHandler>();
|
|
||||||
|
|
||||||
private contentRef = React.createRef<View>();
|
private contentRef = React.createRef<View>();
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -430,6 +430,7 @@ export default class Card extends React.Component<Props> {
|
|||||||
shadowEnabled,
|
shadowEnabled,
|
||||||
gestureEnabled,
|
gestureEnabled,
|
||||||
gestureDirection,
|
gestureDirection,
|
||||||
|
pageOverflowEnabled,
|
||||||
children,
|
children,
|
||||||
containerStyle: customContainerStyle,
|
containerStyle: customContainerStyle,
|
||||||
contentStyle,
|
contentStyle,
|
||||||
@@ -499,7 +500,6 @@ export default class Card extends React.Component<Props> {
|
|||||||
pointerEvents="box-none"
|
pointerEvents="box-none"
|
||||||
>
|
>
|
||||||
<PanGestureHandler
|
<PanGestureHandler
|
||||||
ref={this.gestureRef}
|
|
||||||
enabled={layout.width !== 0 && gestureEnabled}
|
enabled={layout.width !== 0 && gestureEnabled}
|
||||||
onGestureEvent={handleGestureEvent}
|
onGestureEvent={handleGestureEvent}
|
||||||
onHandlerStateChange={this.handleGestureStateChange}
|
onHandlerStateChange={this.handleGestureStateChange}
|
||||||
@@ -523,14 +523,14 @@ export default class Card extends React.Component<Props> {
|
|||||||
pointerEvents="none"
|
pointerEvents="none"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<View
|
<CardSheet
|
||||||
ref={this.contentRef}
|
ref={this.contentRef}
|
||||||
style={[styles.content, contentStyle]}
|
enabled={pageOverflowEnabled}
|
||||||
|
layout={layout}
|
||||||
|
style={contentStyle}
|
||||||
>
|
>
|
||||||
<StackGestureRefContext.Provider value={this.gestureRef}>
|
{children}
|
||||||
{children}
|
</CardSheet>
|
||||||
</StackGestureRefContext.Provider>
|
|
||||||
</View>
|
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</PanGestureHandler>
|
</PanGestureHandler>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
@@ -544,10 +544,6 @@ const styles = StyleSheet.create({
|
|||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
content: {
|
|
||||||
flex: 1,
|
|
||||||
overflow: 'hidden',
|
|
||||||
},
|
|
||||||
overlay: {
|
overlay: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Route,
|
Route,
|
||||||
Scene,
|
Scene,
|
||||||
Layout,
|
Layout,
|
||||||
|
StackCardMode,
|
||||||
StackHeaderMode,
|
StackHeaderMode,
|
||||||
TransitionPreset,
|
TransitionPreset,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
@@ -51,6 +52,7 @@ type Props = TransitionPreset & {
|
|||||||
horizontal?: number;
|
horizontal?: number;
|
||||||
};
|
};
|
||||||
gestureVelocityImpact?: number;
|
gestureVelocityImpact?: number;
|
||||||
|
mode: StackCardMode;
|
||||||
headerMode: StackHeaderMode;
|
headerMode: StackHeaderMode;
|
||||||
headerShown?: boolean;
|
headerShown?: boolean;
|
||||||
headerTransparent?: boolean;
|
headerTransparent?: boolean;
|
||||||
@@ -79,6 +81,7 @@ function CardContainer({
|
|||||||
gestureVelocityImpact,
|
gestureVelocityImpact,
|
||||||
getPreviousRoute,
|
getPreviousRoute,
|
||||||
getFocusedRoute,
|
getFocusedRoute,
|
||||||
|
mode,
|
||||||
headerMode,
|
headerMode,
|
||||||
headerShown,
|
headerShown,
|
||||||
headerStyleInterpolator,
|
headerStyleInterpolator,
|
||||||
@@ -184,6 +187,7 @@ function CardContainer({
|
|||||||
accessibilityElementsHidden={!focused}
|
accessibilityElementsHidden={!focused}
|
||||||
importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}
|
importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}
|
||||||
pointerEvents={active ? 'box-none' : pointerEvents}
|
pointerEvents={active ? 'box-none' : pointerEvents}
|
||||||
|
pageOverflowEnabled={headerMode === 'screen' && mode === 'card'}
|
||||||
containerStyle={
|
containerStyle={
|
||||||
headerMode === 'float' && !headerTransparent && headerShown !== false
|
headerMode === 'float' && !headerTransparent && headerShown !== false
|
||||||
? { marginTop: headerHeight }
|
? { marginTop: headerHeight }
|
||||||
|
|||||||
49
packages/stack/src/vendor/views/Stack/CardSheet.tsx
vendored
Normal file
49
packages/stack/src/vendor/views/Stack/CardSheet.tsx
vendored
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import { View, ViewProps, StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
type Props = ViewProps & {
|
||||||
|
enabled: boolean;
|
||||||
|
layout: { width: number; height: number };
|
||||||
|
children: React.ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
// This component will render a page which overflows the screen
|
||||||
|
// if the container fills the body by comparing the size
|
||||||
|
// This lets the document.body handle scrolling of the content
|
||||||
|
// It's necessary for mobile browsers to be able to hide address bar on scroll
|
||||||
|
export default React.forwardRef<View, Props>(function CardSheet(
|
||||||
|
{ enabled, layout, style, ...rest },
|
||||||
|
ref
|
||||||
|
) {
|
||||||
|
const [fill, setFill] = React.useState(false);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (typeof document === 'undefined' || !document.body) {
|
||||||
|
// Only run when DOM is available
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const width = document.body.clientWidth;
|
||||||
|
const height = document.body.clientHeight;
|
||||||
|
|
||||||
|
setFill(width === layout.width && height === layout.height);
|
||||||
|
}, [layout.height, layout.width]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
{...rest}
|
||||||
|
ref={ref}
|
||||||
|
style={[enabled && fill ? styles.page : styles.card, style]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
minHeight: '100%',
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
flex: 1,
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -520,6 +520,7 @@ export default class CardStack extends React.Component<Props, State> {
|
|||||||
onHeaderHeightChange={this.handleHeaderLayout}
|
onHeaderHeightChange={this.handleHeaderLayout}
|
||||||
getPreviousRoute={getPreviousRoute}
|
getPreviousRoute={getPreviousRoute}
|
||||||
getFocusedRoute={this.getFocusedRoute}
|
getFocusedRoute={this.getFocusedRoute}
|
||||||
|
mode={mode}
|
||||||
headerMode={headerMode}
|
headerMode={headerMode}
|
||||||
headerShown={headerShown}
|
headerShown={headerShown}
|
||||||
headerTransparent={headerTransparent}
|
headerTransparent={headerTransparent}
|
||||||
@@ -565,7 +566,6 @@ export default class CardStack extends React.Component<Props, State> {
|
|||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
overflow: 'hidden',
|
|
||||||
},
|
},
|
||||||
floating: {
|
floating: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { View, Platform, StyleSheet } from 'react-native';
|
import { View, Platform, StyleSheet } from 'react-native';
|
||||||
import { SafeAreaConsumer, EdgeInsets } from 'react-native-safe-area-context';
|
import { SafeAreaConsumer, EdgeInsets } from 'react-native-safe-area-context';
|
||||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
||||||
import {
|
import {
|
||||||
StackActions,
|
StackActions,
|
||||||
NavigationState as StackNavigationState,
|
NavigationState as StackNavigationState,
|
||||||
@@ -9,6 +8,7 @@ import {
|
|||||||
SceneView,
|
SceneView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
|
|
||||||
|
import { GestureHandlerRootView } from '../GestureHandler';
|
||||||
import CardStack from './CardStack';
|
import CardStack from './CardStack';
|
||||||
import KeyboardManager from '../KeyboardManager';
|
import KeyboardManager from '../KeyboardManager';
|
||||||
import HeaderContainer, {
|
import HeaderContainer, {
|
||||||
@@ -359,7 +359,10 @@ export default class StackView extends React.Component<Props, State> {
|
|||||||
|
|
||||||
this.handleTransitionComplete();
|
this.handleTransitionComplete();
|
||||||
|
|
||||||
if (!state.routes.some((r) => r.key === route.key)) {
|
if (
|
||||||
|
this.state.replacingRouteKeys.every((key) => key !== route.key) &&
|
||||||
|
!state.routes.some((r) => r.key === route.key)
|
||||||
|
) {
|
||||||
// If route isn't present in current state, assume that a close animation was cancelled
|
// If route isn't present in current state, assume that a close animation was cancelled
|
||||||
// So we need to add this route back to the state
|
// So we need to add this route back to the state
|
||||||
navigation.dispatch(NavigationActions.navigate(route));
|
navigation.dispatch(NavigationActions.navigate(route));
|
||||||
@@ -446,41 +449,43 @@ export default class StackView extends React.Component<Props, State> {
|
|||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
const headerMode =
|
const headerMode =
|
||||||
mode !== 'modal' && Platform.OS === 'ios' ? 'float' : 'screen';
|
mode === 'card' && Platform.OS === 'ios' ? 'float' : 'screen';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GestureHandlerWrapper style={styles.container}>
|
<>
|
||||||
<SafeAreaProviderCompat>
|
<GestureHandlerWrapper style={styles.container}>
|
||||||
<SafeAreaConsumer>
|
<SafeAreaProviderCompat>
|
||||||
{(insets) => (
|
<SafeAreaConsumer>
|
||||||
<KeyboardManager enabled={keyboardHandlingEnabled !== false}>
|
{(insets) => (
|
||||||
{(props) => (
|
<KeyboardManager enabled={keyboardHandlingEnabled !== false}>
|
||||||
<CardStack
|
{(props) => (
|
||||||
mode={mode}
|
<CardStack
|
||||||
insets={insets as EdgeInsets}
|
mode={mode}
|
||||||
getPreviousRoute={this.getPreviousRoute}
|
insets={insets as EdgeInsets}
|
||||||
getGesturesEnabled={this.getGesturesEnabled}
|
getPreviousRoute={this.getPreviousRoute}
|
||||||
routes={routes}
|
getGesturesEnabled={this.getGesturesEnabled}
|
||||||
openingRouteKeys={openingRouteKeys}
|
routes={routes}
|
||||||
closingRouteKeys={closingRouteKeys}
|
openingRouteKeys={openingRouteKeys}
|
||||||
onOpenRoute={this.handleOpenRoute}
|
closingRouteKeys={closingRouteKeys}
|
||||||
onCloseRoute={this.handleCloseRoute}
|
onOpenRoute={this.handleOpenRoute}
|
||||||
onTransitionStart={this.handleTransitionStart}
|
onCloseRoute={this.handleCloseRoute}
|
||||||
onTransitionEnd={this.handleTransitionEnd}
|
onTransitionStart={this.handleTransitionStart}
|
||||||
renderHeader={this.renderHeader}
|
onTransitionEnd={this.handleTransitionEnd}
|
||||||
renderScene={this.renderScene}
|
renderHeader={this.renderHeader}
|
||||||
headerMode={headerMode}
|
renderScene={this.renderScene}
|
||||||
state={state}
|
headerMode={headerMode}
|
||||||
descriptors={descriptors}
|
state={state}
|
||||||
{...rest}
|
descriptors={descriptors}
|
||||||
{...props}
|
{...rest}
|
||||||
/>
|
{...props}
|
||||||
)}
|
/>
|
||||||
</KeyboardManager>
|
)}
|
||||||
)}
|
</KeyboardManager>
|
||||||
</SafeAreaConsumer>
|
)}
|
||||||
</SafeAreaProviderCompat>
|
</SafeAreaConsumer>
|
||||||
</GestureHandlerWrapper>
|
</SafeAreaProviderCompat>
|
||||||
|
</GestureHandlerWrapper>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
81
packages/stack/src/vendor/views/TouchableItem.native.tsx
vendored
Normal file
81
packages/stack/src/vendor/views/TouchableItem.native.tsx
vendored
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/**
|
||||||
|
* TouchableItem renders a touchable that looks native on both iOS and Android.
|
||||||
|
*
|
||||||
|
* It provides an abstraction on top of TouchableNativeFeedback and
|
||||||
|
* TouchableOpacity.
|
||||||
|
*
|
||||||
|
* On iOS you can pass the props of TouchableOpacity, on Android pass the props
|
||||||
|
* of TouchableNativeFeedback.
|
||||||
|
*/
|
||||||
|
import * as React from 'react';
|
||||||
|
import {
|
||||||
|
Platform,
|
||||||
|
TouchableNativeFeedback,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
ViewProps,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
|
import BorderlessButton from './BorderlessButton';
|
||||||
|
|
||||||
|
export type Props = ViewProps & {
|
||||||
|
pressColor: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
borderless?: boolean;
|
||||||
|
delayPressIn?: number;
|
||||||
|
onPress?: () => void;
|
||||||
|
children: React.ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
const ANDROID_VERSION_LOLLIPOP = 21;
|
||||||
|
|
||||||
|
export class TouchableItem extends React.Component<Props> {
|
||||||
|
static defaultProps = {
|
||||||
|
borderless: false,
|
||||||
|
pressColor: 'rgba(0, 0, 0, .32)',
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
/*
|
||||||
|
* TouchableNativeFeedback.Ripple causes a crash on old Android versions,
|
||||||
|
* therefore only enable it on Android Lollipop and above.
|
||||||
|
*
|
||||||
|
* All touchables on Android should have the ripple effect according to
|
||||||
|
* platform design guidelines.
|
||||||
|
* We need to pass the background prop to specify a borderless ripple effect.
|
||||||
|
*/
|
||||||
|
if (
|
||||||
|
Platform.OS === 'android' &&
|
||||||
|
Platform.Version >= ANDROID_VERSION_LOLLIPOP
|
||||||
|
) {
|
||||||
|
const { style, pressColor, borderless, children, ...rest } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableNativeFeedback
|
||||||
|
{...rest}
|
||||||
|
useForeground={TouchableNativeFeedback.canUseNativeForeground()}
|
||||||
|
background={TouchableNativeFeedback.Ripple(pressColor, borderless)}
|
||||||
|
>
|
||||||
|
<View style={style}>{React.Children.only(children)}</View>
|
||||||
|
</TouchableNativeFeedback>
|
||||||
|
);
|
||||||
|
} else if (Platform.OS === 'ios') {
|
||||||
|
return (
|
||||||
|
<BorderlessButton
|
||||||
|
hitSlop={{ top: 10, bottom: 10, right: 10, left: 10 }}
|
||||||
|
disallowInterruption
|
||||||
|
enabled={!this.props.disabled}
|
||||||
|
{...this.props}
|
||||||
|
>
|
||||||
|
{this.props.children}
|
||||||
|
</BorderlessButton>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<TouchableOpacity {...this.props}>
|
||||||
|
{this.props.children}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,80 +1,3 @@
|
|||||||
/**
|
import { TouchableOpacity } from 'react-native';
|
||||||
* TouchableItem renders a touchable that looks native on both iOS and Android.
|
|
||||||
*
|
|
||||||
* It provides an abstraction on top of TouchableNativeFeedback and
|
|
||||||
* TouchableOpacity.
|
|
||||||
*
|
|
||||||
* On iOS you can pass the props of TouchableOpacity, on Android pass the props
|
|
||||||
* of TouchableNativeFeedback.
|
|
||||||
*/
|
|
||||||
import * as React from 'react';
|
|
||||||
import {
|
|
||||||
Platform,
|
|
||||||
TouchableNativeFeedback,
|
|
||||||
TouchableOpacity,
|
|
||||||
View,
|
|
||||||
ViewProps,
|
|
||||||
} from 'react-native';
|
|
||||||
|
|
||||||
import BorderlessButton from './BorderlessButton';
|
export const TouchableItem = (TouchableOpacity as any) as typeof import('./TouchableItem.native').TouchableItem;
|
||||||
|
|
||||||
type Props = ViewProps & {
|
|
||||||
pressColor: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
borderless?: boolean;
|
|
||||||
delayPressIn?: number;
|
|
||||||
onPress?: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
const ANDROID_VERSION_LOLLIPOP = 21;
|
|
||||||
|
|
||||||
export default class TouchableItem extends React.Component<Props> {
|
|
||||||
static defaultProps = {
|
|
||||||
borderless: false,
|
|
||||||
pressColor: 'rgba(0, 0, 0, .32)',
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
/*
|
|
||||||
* TouchableNativeFeedback.Ripple causes a crash on old Android versions,
|
|
||||||
* therefore only enable it on Android Lollipop and above.
|
|
||||||
*
|
|
||||||
* All touchables on Android should have the ripple effect according to
|
|
||||||
* platform design guidelines.
|
|
||||||
* We need to pass the background prop to specify a borderless ripple effect.
|
|
||||||
*/
|
|
||||||
if (
|
|
||||||
Platform.OS === 'android' &&
|
|
||||||
Platform.Version >= ANDROID_VERSION_LOLLIPOP
|
|
||||||
) {
|
|
||||||
const { style, pressColor, borderless, children, ...rest } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<TouchableNativeFeedback
|
|
||||||
{...rest}
|
|
||||||
useForeground={TouchableNativeFeedback.canUseNativeForeground()}
|
|
||||||
background={TouchableNativeFeedback.Ripple(pressColor, borderless)}
|
|
||||||
>
|
|
||||||
<View style={style}>{React.Children.only(children)}</View>
|
|
||||||
</TouchableNativeFeedback>
|
|
||||||
);
|
|
||||||
} else if (Platform.OS === 'ios') {
|
|
||||||
return (
|
|
||||||
<BorderlessButton
|
|
||||||
hitSlop={{ top: 10, bottom: 10, right: 10, left: 10 }}
|
|
||||||
disallowInterruption
|
|
||||||
enabled={!this.props.disabled}
|
|
||||||
{...this.props}
|
|
||||||
>
|
|
||||||
{this.props.children}
|
|
||||||
</BorderlessButton>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<TouchableOpacity {...this.props}>
|
|
||||||
{this.props.children}
|
|
||||||
</TouchableOpacity>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.8.13](https://github.com/react-navigation/tabs/compare/react-navigation-tabs@2.8.12...react-navigation-tabs@2.8.13) (2020-04-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package react-navigation-tabs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.8.12](https://github.com/react-navigation/tabs/compare/react-navigation-tabs@2.8.11...react-navigation-tabs@2.8.12) (2020-04-22)
|
## [2.8.12](https://github.com/react-navigation/tabs/compare/react-navigation-tabs@2.8.11...react-navigation-tabs@2.8.12) (2020-04-22)
|
||||||
|
|
||||||
**Note:** Version bump only for package react-navigation-tabs
|
**Note:** Version bump only for package react-navigation-tabs
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-navigation-tabs",
|
"name": "react-navigation-tabs",
|
||||||
"version": "2.8.12",
|
"version": "2.8.13",
|
||||||
"description": "Tab Navigation components for React Navigation",
|
"description": "Tab Navigation components for React Navigation",
|
||||||
"main": "lib/commonjs/index.js",
|
"main": "lib/commonjs/index.js",
|
||||||
"module": "lib/module/index.js",
|
"module": "lib/module/index.js",
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
"react-native-gesture-handler": "^1.6.0",
|
"react-native-gesture-handler": "^1.6.0",
|
||||||
"react-native-reanimated": "^1.2.0",
|
"react-native-reanimated": "^1.2.0",
|
||||||
"react-native-tab-view": "^2.13.0",
|
"react-native-tab-view": "^2.13.0",
|
||||||
"react-navigation": "^4.3.8",
|
"react-navigation": "^4.3.9",
|
||||||
"typescript": "~3.8.3"
|
"typescript": "~3.8.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"lib": ["esnext"],
|
"lib": ["esnext", "dom"],
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
|||||||
@@ -3202,10 +3202,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.7.tgz#a65ce0702f55cb67fd777995de6fc7b3e5781903"
|
resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.7.tgz#a65ce0702f55cb67fd777995de6fc7b3e5781903"
|
||||||
integrity sha512-9KbP7LTLFz9dx1heURJbO6nuVMdSjDez8znlrUzaB1nUwKVsTTwlKRuHxGUYIIkReLWrJQeCv9tidy+84z2eCw==
|
integrity sha512-9KbP7LTLFz9dx1heURJbO6nuVMdSjDez8znlrUzaB1nUwKVsTTwlKRuHxGUYIIkReLWrJQeCv9tidy+84z2eCw==
|
||||||
|
|
||||||
"@react-navigation/stack@^5.2.12":
|
"@react-navigation/stack@^5.2.16":
|
||||||
version "5.2.12"
|
version "5.2.16"
|
||||||
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.2.12.tgz#3c171827b1dfd4ff37d740a2be09a07d32d04073"
|
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.2.16.tgz#0ab0b8b401f13f5823de7334a643baac3bc3cd04"
|
||||||
integrity sha512-CQPF8QwBugMm2oVUVd7I9tMi7FdFRqoUrqLU5su5gzSiT2PR13kSkJRYNf+vM7UY8JXjENRLJ1pnt7aL4MG0mg==
|
integrity sha512-0l0Aalj5RNcHLVaS2hgrs58eNDHlkAGPeyEUFcxbk2ii93F8W9MmSCYUn+Tpvruqfv/m9FnyLbQ1DpQOxsekIg==
|
||||||
dependencies:
|
dependencies:
|
||||||
color "^3.1.2"
|
color "^3.1.2"
|
||||||
react-native-iphone-x-helper "^1.2.1"
|
react-native-iphone-x-helper "^1.2.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user