704 Commits

Author SHA1 Message Date
Sergei
5a26506595 Disable / enable swipe depending on screen. (#2906)
* Disable / enable swipe depending on screen.

react-community#1760

* Updated to master

* Revert "Updated to master"

This reverts commit a3aede19588cdbc7fc9148d148260f51d6316e6f.

* - Fixed CircleCI errors

* - Fixed CircleCI errors
2017-12-01 15:53:26 -06:00
James Reggio
5cb42bdf5d Await promise from Transitioner onTransitionStart (#2946)
* Await promise from onTransitionStart

* Review feedback

* Update docs for onTransitionEnd
2017-12-01 15:42:53 -06:00
Flo
d5618ebd41 Drawer Improvement, Let define a route key to open/close multiple dra… (#1803)
* Drawer Improvement, Let define a route key to open/close multiple drawer with no side effects

* fix lint issues

* fix flow issues
2017-11-29 09:01:35 -06:00
tab
368bc615c1 Set sdkVersion to 23.0.0 (#3037) 2017-11-25 16:12:51 -06:00
Ashoat Tevosyan
f332b6bdf7 Add NavigationContainer and NavigationContainerProps types (#3030)
Adding types for these fixes the errors we're seeing when using `TabNavigator` and `StackNavigator`.
2017-11-22 14:42:17 +00:00
Spencer Carli
b5700b9277 v1.0.0-beta.21 v1.0.0-beta.21 2017-11-21 09:25:24 -06:00
Spencer Carli
ad59d161db
Fix #3020 (#3024) 2017-11-21 09:24:24 -06:00
Vojtech Novak
cc355dcee9 return null if it is passed (#3021) 2017-11-21 08:54:46 -06:00
mukunzidd
04c075c1bb Fix typo On "Getting Started 3." (#3022)
Browse the official example app, which will `demonstrates` various patterns with React Navigation. 
demonstrates should be `demonstrate`
2017-11-21 15:40:01 +01:00
londonoliver
7ae6908428 Update Guide-Quick-Start.md (#3015) 2017-11-21 08:34:39 +01:00
Spencer Carli
93dd28749d Bump version v1.0.0-beta.20 2017-11-20 19:21:19 -06:00
Vojtech Novak
7f1fb8cdd8 revert TabBarBottom should hide itself when Keyboard is activated (#3013) 2017-11-20 19:18:35 -06:00
Dave Rogers
0a662c9835 Allow transition configuration between tabs (#2222)
* allow transition configuration between tabs

* we don't need to pass configureTransition to TabBarComponent

* Update TabAnimations.js

* Update TabNavigator.md
2017-11-21 00:16:43 +01:00
Ashoat Tevosyan
3cff180224 Update to react-native@0.50 and flow-bin@0.56 (#2998)
* Update to React Native 0.50

* Type Promise used in PlatformHelpers.web.js

* Move $FlowFixMe in CardStack.js

The line number Flow is using for this error changed. The underlying problem has not, but I don't have time to fix it now unfortunately.

* Type TouchableItem's children prop as React.Node

This was my bad. `React.ChildrenArray` should only really be used in the case of having multiple of the same type of child.

* Type HeaderTitle's children prop as React.Node

Same as last commit.

* Add assertion in StackRouter that StateUtils.indexOf returns valid index

Flow doesn't realize that `StateUtils.indexOf` is guaranteed to return a valid index, so we use `invariant` to assert it.

* Remove unused type DrawerNavigationState from TypeDefinition

* Remove unused type parameter T in DrawerView

* Type NavigationStateRoute as NavigationLeafRoute & NavigationState

* Don't constrain generic action types to NavigationAction

By constraining to subtypes of `NavigationAction`, we actually are requiring that any router satisfying our type constraints has to take all of the `NavigationAction` types. Instead, we want to say that it will only take some of them. Changing the types here to be inferred.

* Fix types of NavigationScreenProp and withCachedChildNavigation

1. `NavigationScreenProp` needs to have its type parameter annotated with a `+` to actually indicate covariance on that type parameter, apparently
2. `withCachedChildNavigation` needs to thread through more-specific `NavigationState`s, and right now it just discards that specificity, which breaks `DrawerSidebar` because it needs a `NavigationStateRoute`

* Ignore website/build from Flow

* Fix type of DrawerItems activeItemKey prop

- Even when specified, it can be `null`
- Use a ternary expression instead of `x && x.param` approach

* Get rid of NavigationRouter & NavigationNavigator parameterization on NavigationAction

Since `NavigationRouter`'s `getStateForAction` functionality is a standard Redux reducer, it knows to forward on any actions it doesn't know how to deal with. We can widen the types of these functions to be `NavigationAction` without any negative consequence.

* Explicitly specify null navigationOptions in createNavigator

Not sure why, but Flow doesn't like us leaving it unspecified

* Fix createNavigationContainer/createNavigator/StackNavigator types

* Fix up flow types for TabNavigator and DrawerNavigator

* Properly type defaultContentComponent

* Fix more flow errors in createNavigationContainer

* Replace NavigatorProps with NavigationNavigatorProps

* Type SceneView's navigation prop as NavigationScreenProp<any>

There is an unavoidable* type problem here. A `NavigationComponent` is either a navigator with a `NavigationStateRoute` or a scene with a `NavigationRoute`. The navigation prop it gets passed must match the component's `NavigationState`. However, there's no way for us to say that "`this.props.router.getComponentForRouteName` will have a `NavigationNavigator` iff the corresponding `childNavigationProps` is a `NavigationStateRoute`".

The cleanest way to make this work is to throw an "any" specifically for the navigation prop's state type param.

* We could probably avoid it with sufficient refactoring. If the routers were charged with keeping track of `childNavigationProps` instead of leaving it to the views, they could return the child navigation prop and child `NavigationComponent` in pairs whose types were coupled.

* Pass in screenProps to NavigationComponent in NavigationPlayground's CustomTabs

Flow wants `screenProps` to be passed in here for some reason...

It cites `SceneView`, but that doesn't really make much sense to me. But this is some custom logic that most people aren't likely to run into, so I'm not gonna worry too much about it.

* Patch mismatch with react-native-tab-view type for now

* Use generic NavigationState in createNavigationContainer's _nav var

We made the NavigationState generic while #1313 added a new instance variable. This updates the new instance variable to be generic.

* Fix failing tests
2017-11-20 13:53:48 -06:00
pietro909
88dfd84cf5 Add previous scene to tabBarOnPress - fix #2787 (#2790)
* Add previous scene to tabBarOnPress - fix #2787

* Update docs for tabBarOnPress
2017-11-19 16:00:10 -06:00
Ashoat Tevosyan
4e48d43f0f Allow strings Component types through as screens (#2999)
In React Fiber (React 16), strings are used for intrinsics like 'div' and 'View'. As a result, if you use a View as a screen in an academic experience, you get a red error screen. This PR prevents that from happening.
2017-11-19 15:04:33 -06:00
Iain Diamond
e0704e48a1 Guide-Headers.md (#3000)
Spelling/Typos fixes
2017-11-19 18:24:27 +01:00
Daniel Friesen
caf83794e0 Dispatch can be called multiple times per tick (#1313)
Mostly fixes #1206
2017-11-18 02:15:10 +01:00
Vojtech Novak
65f44ae003
Update withNavigation.md (#2988) 2017-11-17 00:03:27 +01:00
Shubhnik Singh
24a3a79996 Improvement in redux-integration documentation. (#2964)
* Added a guide to intermediate concepts.

* Documentation improvement for redux integration.

* redux-integration feedback incorporated

* incorporated feedback

* heading style changes
2017-11-16 23:21:56 +01:00
Daniel Friesen
e25bdd2ed2 Fix default width of drawer (#2978)
* Fix default width of drawer

Current implementation is simplified / broken.

- The drawerWidth doesn't work for tablets, the drawer becomes massively large
- Header size changes (and thus drawer width changes) in landscape mode on iOS are not accounted for
- An incorrect 64px header size is used for iOS (this includes the status bar height that doesn't belong in the calculation)

Implement a default drawerWidth as a function that follows the Material Design spec closer:
- Screen width - header height
- Use the correct iOS app bar height in portrait and landscape mode
- Drawer max height of 280 on mobile and 320 on tablet

* Update snapshot for drawer width change
2017-11-15 12:04:15 -08:00
James Reggio
346264e132 Add toString() with type for each NavigationAction (#2260)
* Add toString() with type for each NavigationAction

* Add documentation for toString() on NavigationActions
2017-11-15 04:19:55 +01:00
Dave Pack
f2f4e5ce44 Move SafeAreaView out of DrawerNavigatorItems to DrawerSidebar. (#2967)
* Move SafeAreaView out of DrawerNavigatorItems to DrawerSidebar.

The SafeAreaView was breaking custom contentContainers in drawers. Fixes #2963.

* Fix SafeAreaView in DrawerItems and Drawer contentComponent

* Fix flow error and tests.

* Update Drawer documentation with SafeAreaView recommendation. Remove one of the examples for `contentComponent`.

* Put the View back.

* Update snapshot.
2017-11-14 14:09:59 -06:00
Vojtech Novak
931677781e Allow custom header and back button to use the props from react-navigation (#2712)
* allow custom header components

* nicer condtition

* trigger another build

* trigger another build

* distinguist headerLeft component and element

* add docs

* fix typo

* suppress flow
2017-11-14 13:31:21 -06:00
Vojtech Novak
dec79f6a99 Update Guide-Headers.md (#2949)
* Update Guide-Headers.md

* Update Guide-Headers.md
2017-11-14 16:52:39 +00:00
Vojtech Novak
44616dd45a fix 2953 (#2976) 2017-11-14 16:28:52 +00:00
Murad R
fafe68b8cb prevent error `RawText "" must be wrapped in an explicit <Text> compo… (#2415)
this react-native error has no adequate stack, and i waste 4 hours for juggling pieces, until i get the idea to trace error by myself and finded this bug
2017-11-13 10:16:50 +00:00
Mujavid Bukhari
87a1b77525 Update TabBarBottom to accept styling for animations (#2945)
* Update TabBarBottom.js

* Update TabNavigator-test.js.snap

* Update TabView-test.js.snap
2017-11-12 13:00:59 -08:00
Spencer Carli
f0e9f70320 Improve Contributing Guide (#2960)
* Put contributing file in a place where github will pick it up

* New contributing guide
2017-11-10 23:55:33 +00:00
Shubhnik Singh
e396795753 Added a guide under intermediate concepts. (#2958) 2017-11-10 13:26:29 +00:00
rmevans9
53472b72f9 SafeAreaView - Fix for Web usage (#2950) 2017-11-10 11:02:24 +00:00
Zach Bradshaw
6e4afe2153 Fix 'good first issue' link in README (#2919) 2017-11-06 15:25:16 -06:00
tim-soft
838b7c369a [Docs] Fix Comparisons Link in Readme (#2910) 2017-11-06 18:00:25 +01:00
Hawken Rives
6a6207ce7b Export all Flow types from TypeDefinition (#2903) 2017-11-06 09:57:29 -05:00
Martin Malfertheiner
79317e83ae Fix issue #618 - TabBarBottom should hide itself when Keyboard is activated (#1764)
* Fix issue #618 - TabBarBottom should hide when Keyboard is activated

* fix undefined check for _keyboardDidHideSub

* fix prettier

* Update TabBarBottom.js

* Update TabBarBottom.js

* Update TabBarBottom.js

* Update TabBarBottom.js

* Update TabBarBottom.js
2017-11-05 00:44:03 +01:00
Brent Vatne
ffb95fdb73 Bump to beta.19 v1.0.0-beta.19 2017-11-03 15:14:56 -07:00
Brent Vatne
d93acdd918 Add back Header.HEIGHT but with a deprecation warning 2017-11-03 15:07:35 -07:00
Vojtech Novak
b9d1d0d021
improve wording in router docs (#2894) 2017-11-03 20:59:00 +01:00
James Gillmore
7adad618d1 add 2nd params argument to StackRouter.getActionForPathAndParams (#1623)
* add 2nd params argument to StackRouter.getActionForPathAndParams

It still falls back to parsing the query string if no params argument is provided, but now TabRouter.getActionForPathAndParams which might call StackRouter.getActionForPathAndParams with a 2nd params argument will work correctly. 

In addition, if called directly (as may be the case in apps with custom deep-linking needs [which is my primary case]), it will function correctly without users having to build a query string. 

This also solves the problem that deserialization of query strings is currently implemented without support for cases like nested arrays within the query string.

* Update StackRouter.js
2017-11-03 20:19:54 +01:00
Brent Vatne
06cfeb5b2b Bump version v1.0.0-beta.17 2017-11-02 18:30:53 -07:00
Dave Pack
c0474bb644 SafeAreaView padding from style prop (#2889)
* SafeAreaView now adds padding from style object. If height is specified, inset padding is added to height.

* Header now only accepts headerStyle prop, backgroundColor works as expected.

* TabBarBottom now only accepts style prop, backgroundColor works as expected. Fixes top inset bug.

* Update snapshot.

* Add clarifying comment.

* Support padding with percentage.
2017-11-02 18:14:15 -07:00
Brent Vatne
29ae6f46f6
Safe area example (#2890)
* Add SafeAreaEample for testing

* Remove portrait default lock on SafeAreaExample and add a spacer between buttons
2017-11-02 18:12:11 -07:00
Dave Pack
f899b2eb13 Fixes inputRange on headerStyleInterpolator (#2873) 2017-11-02 13:53:36 +00:00
Abner
e1da55e049 add run redux example script in package.json (#1634) 2017-11-02 10:57:36 +01:00
Emerson Laurentino
43640754cb improve TouchableItem props (#2841)
* Replace props style

* fix: remove eslint-disable-line no-unused-vars

* Update TouchableItem.js

* Update TouchableItem.js
2017-11-02 00:13:45 +01:00
Dave Pack
c5f8eb20d8
Override forceInset on DrawerItems. (#2872)
Fixes second part of issue #2854.

`itemsContainerForceInset` takes the same object as `forceInset` on SafeAreaView. It overrides the SafeAreaView container in DrawerItems.
2017-11-01 15:48:39 -07:00
Dave Pack
313ec7ab76 Fix backgroundColor in Header and TabBar (#2871)
* Add headerBackgroundColor to navigationOptions

* Add backgroundColor to tabBarOptions

* Update snapshots.

* Update docs.
2017-11-01 16:33:50 -05:00
Dave Pack
ed2fc9a09e Fix ios check and array destructuring bug #2853 2017-10-31 15:24:52 -07:00
Spencer Carli
5c533dff89 1.0.0-beta.16 v1.0.0-beta.16 2017-10-31 13:41:14 -05:00
Dave Pack
185289ad66 Add iPhone X SafeAreaView (#2833)
* Add SafeAreaView - JS only version

* Add SafeAreaView

* Looking pretty good

* Small refactor

* Remove console.log

* Fix merge conflict with Header flow types.

* Fix conflict with itemsContainerStyle.

* Fix merge conflict.

* Fix merge conflict, yarn and package.json from fixflow

* Fix merge conflict, navigation playground yarn.lock and package.json with fixflow

* Now it can work on lower versions of RN

* Snapshots merge conflict.

* Update DrawerNavigator snapshot.

* Fix conflict with iconContainerStyle

* Add support for correct status bar height on iPad.

* Update jest snapshots.

* Update StackNavigator snapshot.

* Use modulo instead of while

* Fix landscape tab bar width on < iOS 11
2017-10-31 13:33:40 -05:00