186 Commits

Author SHA1 Message Date
Hirokazu Hata
176a26baa8 Remove unused imported vars (#2718) 2017-10-22 18:21:49 +02:00
Chris Hunter
1ca407b5ec Add tests for navigators (#2796)
Add minimal unit tests for the DrawerNavigator, StackNavigator and
TabNavigator.
2017-10-20 16:35:54 +01:00
Spencer Carli
642af12ecb Fix tabbar bottom issue on Android. (#2774) 2017-10-18 09:16:22 +01:00
Dave Pack
3e37ee6d0c Fixes default drawerWidth to match Material UI patterns. (#2773)
* Fixes default drawerWidth to match material ui patterns.

Previously: calculated based on device width regardless of orientation and did not recalculate when orientation changed.
Now: calculates based on minimum of device height/width, remains constant and guaranteed to always fit screen regardless of orientation.

This is the expected behavior based on observing Google apps (e.g. Gmail). This is also better than recalculating on every orientation change, which would result in variable width drawers and awkward empty space when in landscape in most cases.

* Remove console.log
2017-10-17 18:24:56 -05:00
Spencer Carli
36ffc4f31a [iOS 11] Handle landscape tabbar correctly. (#2676)
* Handle the ios11 tabbar correctly

* Fix an issue when showLabel is false

* Add a basic test for the tabbarbottom

* Add check for ios version number

* Tests shall pass

* make things work for all the versions

* Again, fix the tests
2017-10-16 10:01:30 +01:00
robertkongsvmx
82c2cdbe09 Issue-2662: Add support for testID and accessibilityLabel for tab bar items (#2684) 2017-10-15 19:45:22 -05:00
Finian
f84fe15272 Add allowFontScaling option for TabView and headerTitleAllowFontScaling for HeaderTitle (#2377) (#2721) 2017-10-15 09:57:09 +01:00
Pat Needham
27d496c268 Fix Querystring params not set for nested URI (issue #2251) (#2695)
* fix issue #2251 by including queryString to get nested action

* only use nested query string when original queryString exists, and include test cases
2017-10-09 21:21:39 -05:00
Lucas Padilha
df788fd9ac added property inside drawerConfig to backgroundColor (drawerBackgroundColor) (#2698) 2017-10-08 10:40:08 +01:00
Vojtech Novak
e4a7b7e073 remove ineffective invariant usages, fixes #2258 (#2693)
* remove ineffective invariant usages

* fix flow err

* fix tests

* fix tests

* use throw
2017-10-05 11:59:13 +01:00
Spencer Carli
a8556b0df2 Improve StatusBar/Header Behavior (#2669)
* Track orientation change

* Add tests for withOrientation

* Better variable naming
2017-09-29 16:11:30 -05:00
Ashoat Tevosyan
a79d86b152 Remove @providesModule declarations in src/utils to avoid Flow conflicts with fbjs package (#2665) 2017-09-28 14:42:14 -05:00
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 d71ed75133b97e33a8a683eda334b3005107d379. @skevy reintroduced the mistyped function in 9436d03fe8fface09001a5a40ce0aa8a01ad9e7e, 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 075902147d92e2c5db62c5d66f63d1a4c527cc49.
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