Commit Graph

174 Commits

Author SHA1 Message Date
Masayuki Iwai
69397af74d Make GESTURE_RESPONSE_DISTANCE_* configurable. (#2172)
* Make gestureResponseDistance configurable.

* Fix format.

* Set vertical and horizontal distance individually.

* Fix type error.

* Move gestureResponseDistance to NavigationStackScreenOptions.

* Add documentation.
2017-09-25 20:16:13 +01:00
Ashoat Tevosyan
b759d3136e Fix Flow types (and update RN version) (#2619)
* Fix .flowconfig to stop ignoring modules and properly include React Native libraries

Currently, there are numerous ignored libraries that are hiding type errors. Actually, they're causing type errors too. This sort of thing only patches over actual problems, so we have to revert them to get a config we can build upon.

* Update react-native/flow-bin dependencies

We want to have Flow types working with the latest packages.

* Update flow-typed libraries (auto-generated)

* Fix typing of navigation prop used by withNavigation HOC

The current typing is clearly a typo, as it is circular. `NavigationScreenProp` should be used to type the navigation prop

* Fix typing of easing function

What's funny is that I fixed this before in d71ed75133. @skevy reintroduced the mistyped function in 9436d03fe8, which didn't trigger any Flow errors because .flowconfig was ignoring the entire react-native package

* Correct typing of View and Text style prop

The current code thinks it can import these, but this isn't true, and was being hidden because the .flowconfig ignored the whole react-native package. There's no easy to type Text and View at the current moment, as far as I can tell. Importing the highly generic `StyleObj` seems like the best bet, and is what I have being using in my projects.

* Import NavigationScreenComponent using full path

* Updating yarn.lock files

* Get rid of library overrides in flow-typed/react-native.js and flow/react-navigation.js

* Add @flow to src/react-navigation.js and make last three params to createNavigator optional

* Make screenProps and navigationOptions optional in NavigationNavigatorProps

* yarn run format

* Readd react-navigation/node_modules ignore to NavigationPlayground's .flowconfig

Realized this line I removed in the first commit is necessary when using npm link/yarn link, which is what the CircleCI build does

* Make all DrawerViewConfig's params optional

Some of these params are marked as optional because they have defaults. However, the only place `DrawerViewConfig` is used is as the input the function that then applies the defaults

* Make all props in NavigationNavigatorProps optional

`NavigationNavigatorProps` is used to type the props of the component that is output by the `StackNavigator`, `TabNavigator`, etc. component factories. This component does not need to have any props specified.

* Make second param to `DrawerNavigator` factory optional

`DrawerNavigator`, just like `TabNavigator` and `StackNavigator`, can be called with just a single argument (ie. omitting the config)

* Upgrade to RN 0.48.4 to address https://github.com/facebook/react-native/issues/15810
2017-09-25 11:29:34 -05:00
Jeff Mendez
17c910fb5d drawerLockMode (#1377)
* added drawerLockMode with cabilities to update it on the fly

* fixed incorrect name on markdown for usage

* added handling if screenProps is not being used

* Fix linting error

* Use drawerLockMode instead of lockMode

* Correct docs

* Fix flow issues

* Make drawerLockMode optional
2017-09-21 12:53:46 -05:00
Matt Hamil
2b40182cd7 Reverting last commit (#2626) 2017-09-20 15:08:11 -05:00
Matt Hamil
7832ed72c0 Merge branch 'master' into master 2017-09-20 14:40:37 -05:00
Justin Morris
b7768d12e6 Trivial: cleanup warnings in test suite (#2581)
* Mock and verify console warnings to prevent noise in the test output.

* Tighten up expectations on deprecation output.

* 80 column formatting.

* Actually fix formatting.
2017-09-15 08:42:23 -05:00
Jonathan Kim
23da6aebff Expose useNativeAnimations for Drawer navigator (#2568)
* Expose useNativeAnimations for Drawer navigator

* Default useNativeAnimations to true
2017-09-12 17:03:37 +01:00
Kevin Cooper
fe4b1e2379 Accept a tabBarOnPress param (#1335)
* Accept a 'tabBarOnPress' param

* Make tabBarOnPress a navigationOption
2017-09-12 09:17:37 -05:00
Joey Baker
70785d635a Fix actually remove openURL event listener (#2235)
Previously, we were creating an anonymous function as the event listener handler. This means we can't un-listen because we don't have a reference to the handler.
2017-09-09 11:09:18 -05:00
Manu Bamba
c815626020 Fixed issue with tab navigation (#2527) 2017-09-06 11:42:48 -05:00
Gant Laborde
8fdfc6d7a6 Feature/toggle (#2492)
* add toggle functionality

* add documentation
2017-08-29 21:55:33 -05:00
James Ide
ae9fb10e60 [assets] Optimize back-icon PNGs (#2341)
Ran the images through `optipng -o7 -strip all`. In some cases got the images down from > 1 TCP packet to below 1.
2017-08-08 23:26:18 -07:00
Adam Miskiewicz
eb8434a5b6 Clean up some flow types code-base wide, reorganize cardstack views 2017-07-19 12:59:40 -07:00
Adam Miskiewicz
bbd82dff53 Stricter flow typing on CardStackStyleInterpolator 2017-07-19 12:59:40 -07:00
Adam Miskiewicz
681e1c6e31 Update depenencies, update Prettier 2017-07-19 12:59:40 -07:00
Adam Miskiewicz
ebf1e2e893 Update NavigationPlayground to 0.45.1, add stub react-nav flow definition 2017-07-19 12:59:40 -07:00
Adam Miskiewicz
9436d03fe8 Update to RN 0.45, fix/improve flow coverage 2017-07-19 12:59:39 -07:00
Adam Miskiewicz
8455b75dbd BackAndroid -> BackHandler 2017-07-19 12:59:39 -07:00
Adam Miskiewicz
1919bff719 Disable noisy logging unless process.env.REACT_NAV_LOGGING is set 2017-07-19 12:59:39 -07:00
Adam Miskiewicz
2da42c0cc0 Improved header + tab bar styles on iOS 2017-07-19 12:59:38 -07:00
Yohan Spychala
9037dd3c4e Fix flow type for NavigationParams (#1574) 2017-07-04 02:30:04 -04:00
Nicolas Beck
5e27ecf35e fixed bug with wrong label&icon in Drawer (#1914)
* fixed bug with wrong label&icon in Drawer

* itemPress in Drawer now always navigates to first screen of a nested StackRouter

* used eslint formatting

* added comments
2017-07-04 02:26:16 -04:00
Hugo Dozois
fa9a2d6960 Removed duplicate navigation flow annotation in CardStack (#1993)
- Also defined in the NavigationTransitionProps
2017-07-04 02:25:37 -04:00
Tiziano Munegato
b310b153fd fix header metrics based on Material design guidelines (#2001) 2017-07-04 02:24:29 -04:00
Michael
04b5578c14 Fixed spelling mistake in validateRouteConfigMap (#2049) 2017-07-04 02:23:02 -04:00
Adam Miskiewicz
b354b8eb49 Revert "[BUGFIX] Use a proper source of headerBackTitle (#2007)" (#2018)
This reverts commit 075902147d.
2017-06-28 12:04:56 -07:00
Alexey
075902147d [BUGFIX] Use a proper source of headerBackTitle (#2007) 2017-06-28 23:21:43 +05:30
Fidan Hakaj
a2fdb6d704 Use animatable text component for the header title (#1922)
* Uses animatable text component for the header title

* fix: prettier issue
2017-06-23 17:19:49 -07:00
Koen Punt
fac91e097b allow empty path to be matched (#1811)
previously when opening a deeplink without a path, it would result in an array of 2 empty strings, which is are falsy values, so the full url was passed on.

by checking if the value is actually `undefined` instead of falsy we have no more false positives
2017-06-22 20:30:12 -07:00
Iftekhar Rifat
608217abbc DrawerNav: don't push screen to stack if it's already focused (#1817) 2017-06-22 20:29:30 -07:00
Neo
c61d72f9e7 Fix typo -- movedDistance moveX, moveY -> dy/dx (#1824) 2017-06-22 20:26:54 -07:00
Stefan Roex
d29dc05e73 More iOS-ish transitions (#1786) 2017-06-22 20:24:43 -07:00
Matt Hamil
07c74eff6d Merge branch 'master' into master 2017-06-19 15:58:44 -05:00
Alan Foster
36642ebb69 Reduce rerenders on header back button (#1913) 2017-06-19 12:07:07 +05:30
Matt Hamil
75b4f2371f Merge branch 'master' into master 2017-06-12 14:17:18 -05:00
Koen Punt
3f0577f97a pass screenProps to TabBarComponent (#1841)
To support for example filtering the tabs based on a property passed to a parent navigator, I need to have to access to the screenProps in the tab bar
2017-06-12 19:20:31 +05:30
Matt Hamil
7e96ad4189 Fixed issue with back button 2017-06-06 17:24:13 -05:00
Matt Hamil
484c729154 Updated to react-navigation v1.0.0-beta.11 2017-06-06 14:24:27 -05:00
Matt Hamil
528b1ad812 Stack pushes are now idempotent 2017-06-06 14:15:15 -05:00
James Gillmore
8d91753e9c change TabNavigator type to NavigatorTypes.TABS (#1628) 2017-06-03 12:41:06 -07:00
William Schurman
a60d1d529f Correct sizing of header back button image on iOS (#1687) 2017-06-03 12:22:10 -07:00
Gabriel Bull
77b04f342d Removed dependency on fbjs (#1698) 2017-06-03 12:21:08 -07:00
Kyle Herock
e8ec07d9e3 Expose CardStackTransitioner as export (closes #1326) (#1676) 2017-05-24 12:15:55 -07:00
Gabriel Bull
89db9ea204 Added tabStyle property (#1667) 2017-05-24 11:33:23 +05:30
Adam Miskiewicz
269311c2a3 Fix flow error in CardStack 2017-05-23 21:51:30 -07:00
Gregory
9027e1a88f Fix backAndroid warning (#1520) 2017-05-19 08:57:33 -07:00
Daniel Friesen
03698c9a69 Allow the routes outputted by DrawerView.Items to be overridden (#1039) 2017-05-19 09:23:19 +05:30
Adam Miskiewicz
296becd5d1 Tweak iOS animation easing, gesture tweaks 2017-05-16 23:04:33 -07:00
Adam Miskiewicz
30ca3c1f80 Fix Flow and Tests (#1510)
* Navigation actions should be string literals to work properly with Flow

* Update StackRouter/TabRouter tests with eslint ignore rule

* Use `expect.objectContaining` so we don't rely on keys
2017-05-14 14:18:09 -07:00
Adam Miskiewicz
f3a958dca1 Update/Fix Prettier + Eslint config for codebase
Run Prettier/Eslint on entire codebase, fix issues
2017-05-14 14:18:09 -07:00