Commit Graph

108 Commits

Author SHA1 Message Date
Vojtech Novak
6d75ac9193 Playground facelift (#3708)
* wip

* fix imports

* use stylesheet for margin

stylesheet now correct

* also remove old headerLeft

* improve header buttons color

* remove ios button margin
2018-03-13 21:13:19 +01:00
Brent Vatne
a0e844e311 Add dismiss helper, made possible by also adding carefullyGetParent (#3669)
* Add dismiss action, made possible by getParentState

* Add dismiss to flow interface

* Don't dispatch an action on dismiss helper if no parent state

* carefullyGetParent instead of getParentState
2018-03-12 16:01:29 -07:00
Brent Vatne
3b56ec75c0 Add SwitchNavigator to 2.x 2018-03-07 17:35:15 -08:00
Brent Vatne
6eff94c25f Add isFocused helper to navigation and fix withNavigationFocus 2018-03-03 09:58:19 -08:00
Eric Vicenti
58477fcf40 Drawer Router (#3618) 2018-02-27 18:34:05 -08:00
Eric Vicenti
d2271ad0f0 [BREAKING] New createNavigator API (#3392)
* New createNavigator and View API

See the RFC here:
https://github.com/react-navigation/rfcs/blob/master/text/0002-navigator-view-api.md

* shattered dreams of flow

* fix export

* Fix tab view issues found by brent
2018-02-27 17:27:58 -08:00
Brent Vatne
7cc8feaf05 Several improvements to StackNavigation Header (#3568)
* Refactor to remove unused variables, styles, and outer Animated view

* Style cleanup

* Proof of concept blur background

* Clean it up and add flow interface

* Update snapshots
2018-02-21 18:29:43 -08:00
Brent Vatne
51d396d8ef Remove withNavigationFocus example until it's fixed 2018-02-16 18:10:33 -08:00
Brent Vatne
a4d758ad93 Do not use hide views when swipe or animations are enabled. Improve withNavigationFocus example 2018-02-16 18:05:39 -08:00
Brent Vatne
f9d0777608 Add back support for lazy tabs and use removeClippedSubviews (#3538)
* Lazy initialization of tabs and move contents off-screen when not active

* Make subview clipping and lazy both configurable

* Record snapshots again

* Update type definition

* Remove unused log
2018-02-16 16:59:19 -08:00
Sébastien Lorber
1b6391d83f add withNavigationFocus HOC (#3512)
* add withNavigationFocus HOC

See:
- https://github.com/react-navigation/react-navigation/issues/51#issuecomment-276003658
- https://github.com/react-navigation/react-navigation/issues/51#issuecomment-278761705
- https://github.com/react-navigation/react-navigation/pull/3345#issuecomment-360260067

* typos

* remove unused import

* Add withNavigationFocus export

* add example TabsWithNavigationFocus

* add example TabsWithNavigationFocus

* withNavigationFocus: get navigation from context or props

* subs => subscriptions

* fix flow issues
2018-02-17 01:57:33 +01:00
Brent Vatne
26771dea63 Several small changes related to header style commit 2018-02-16 12:42:44 -08:00
Brent Vatne
6bb609ebea Header transition presets with support for standard iOS transition style (#3526)
Header transition presets with approximate support for UIKit transition style
2018-02-16 12:41:59 -08:00
Sébastien Lorber
3cf67baeeb fix doc link (#3513) 2018-02-13 19:30:20 +01:00
Brent Vatne
3a31758f2d Better orientation layout on playground 2018-02-12 11:53:23 -08:00
Brent Vatne
2c6ce1426a Make Router({ RouteName: Component }) a valid way to configure a router (#3486)
* Make Router({routeName: Component}) a valid way to instantiate a route

* Update App.js in NavigationPlayground

* Fix route config flow type
2018-02-09 18:20:01 -08:00
Brent Vatne
28abefd244 Make it possible to go back to menu from key example and improve banner on menu screen (#3479)
* Make it possible to go back to menu from key example and improve banner on menu screen

* Fix NavigationPlayground flow error
2018-02-08 19:10:54 -08:00
Brent Vatne
36535809cb Prevent navigation from getting in bad state when navigating back to route by key (#3478) 2018-02-08 18:20:14 -08:00
Brent Vatne
1cdf7cecbe Do not use contentInsetAdjustmentBehavior on iOS in ModalStack example 2018-02-08 15:54:14 -08:00
Brent Vatne
061201f7f0 Remove console logs from published version of navigation playground 2018-02-08 12:48:28 -08:00
Brent Vatne
fa22019a20 Add custom back button example 2018-02-07 10:42:06 -08:00
Brent Vatne
95bbcbdb42 Prevent push from bubbling up (#3454) 2018-02-06 17:49:52 -08:00
Brent Vatne
171fd5459e Prevent pop and popToTop from bubbling up to parent stack (#3453) 2018-02-06 17:35:32 -08:00
Eric Vicenti
68ce3654a9 Fix issue with StackRouter popToTop (#3451)
Previously the state was getting squashed, in this case it would destroy the routeName of the state, which was a route for the parent navigator, who could no longer render properly.
2018-02-06 15:56:39 -08:00
Eric Vicenti
72e45722d1 StackNavigator Replace Action (#3440)
* Navigation replace action

The long awaited action to replace the a route in StackNavigator

* Fix flow maybe
2018-02-06 12:59:16 -08:00
Brent Vatne
e4a6c47e28 Use a stack inside of drawer 2018-02-05 14:48:30 -08:00
Brent Vatne
760774453c Remove website, docs and related commit. (#3419)
- This now lives at https://github.com/react-navigation/react-navigation.github.io
2018-02-03 10:38:43 -08:00
Ashoat Tevosyan
aec28f49c4 Redux middleware for new event system (#3399)
* Add Redux bindings for new event system

* construct -> create

* react-navigation-redux-helpers
2018-02-02 14:58:35 -05:00
Ashoat Tevosyan
41096f12b9 Clean up old build process and Babel config (#3406) 2018-02-02 14:57:31 -05:00
Ashoat Tevosyan
8dad94e66c Add Flow libdef (#3391)
* Add Flow libdef

* Move libdef to flow folder in root

* Update libdef with some refinements discovered while writing test

Mostly refining navigator config types. In the past when we tried it we got in-repo Flow errors. With a libdef we can now assert it as true!

* Get rid of all imports in libdef and refine some types
2018-02-01 12:34:35 -05:00
Ashoat Tevosyan
c19fe8f2f5 metro-bundler -> metro (#3396) 2018-01-31 21:41:35 -05:00
Ashoat Tevosyan
a5e50bcfda Add NavigationPlayground Flow test to CI (#3385)
In order to make sure that contributors don't making breaking changes to our Flow types without corresponding updates to the libdefs, we should make sure these breaking changes get caught by CI. Right now our libdefs are any-typed, but I'll put up a PR later that will refine the libdef (located at `flow-typed/npm/react-navigation_vx.x.x.js`).
2018-01-30 18:57:06 -05:00
Ashoat Tevosyan
57e3d98670 Fix NavigationEvent types (#3384)
* Fix SimpleTabs types

dca37627a2 broke the types, but it wasn't noticed because Flow wasn't in the CI. This fixes the types; separate PR coming to add Flow to the CI.

* Refine type of NavigationEventListener callback

Instead of typing the callback as `Function`, we're now using the precise type provided by @ericvicenti

* NavigationEventListener -> NavigationEventSubscription
2018-01-30 18:49:47 -05:00
Ashoat Tevosyan
b735267ea5 Update to RN 0.52 and Expo 25 (#3383)
* Update to RN 0.52 and Expo 25

* Rerecord snapshots for failing Jest tests

* jest-expo@25.1.0-beta.0

* jest-expo@25.1.0
2018-01-30 12:22:20 -06:00
Eric Vicenti
3b88e0872f Add events support to redux example (#3368)
* Fixing redux

* Fix tab events and test event nested event subscriptions

* Add event support to redux example
2018-01-27 14:12:16 -08:00
Brent Vatne
dc2276ad9f Add headerBackImage, closes #1999 2018-01-27 13:53:44 -08:00
TheCodeTalker
1c81982ff3 navigation back fix in example (#3218) 2018-01-28 02:12:45 +05:30
Brent Vatne
49c0fcc2f5 [Playground] Move sdkVersion back to 24 2018-01-26 17:34:08 -08:00
Brent Vatne
9bafc3b60b Revert updates to example package.json 2018-01-26 16:48:02 -08:00
Ashoat Tevosyan
52828e98cb Bring back TypeDefinition.js and re-add Flow to NavigationPlayground (#3363)
* Bring back TypeDefinition.js and re-add Flow to NavigationPlayground

* Type EventListener correctly and ignore metro errors
2018-01-26 17:15:49 -07:00
Eric Vicenti
966ecb53ba Navigation Event Subscriptions (#3345)
* Add fbemitter, keep flow passing

* Begin support for event emitter

- Adds emitter to navigation prop
- Emits top level onAction event
- stub getChildEventSubscriber for child events

* Support navigationState.isNavigating

* Focus and blur events starting to work

- Navigation completion action wired up
- Event chaining logic built in getChildEventSubscriber
- Renamed onAction evt to ‘action’

* Wrap up events progress and testing

* Rename to isTransitioning and COMPLETE_TRANSITION

* rm accidental dependency

* Suppoert event payload type
2018-01-25 00:13:28 -08:00
Adam Miskiewicz
9590b5b35f Make examples use linked copy of react-navigation 2018-01-17 19:11:04 -08:00
Adam Miskiewicz
5c8709b8a4 Revert "Move examples to https://github.com/react-navigation/examples"
This reverts commit 36775007b0.
2018-01-17 14:43:28 -08:00
Brent Vatne
5725ca2807 Move examples to https://github.com/react-navigation/examples 2018-01-17 12:43:24 -08:00
Brent Vatne
74eaafe675 Update icons in playground app and add some padding to banner 2018-01-12 15:49:42 -08:00
Satyajit Sahoo
136f562ea4 Upgrade react-native-tab-view (#3064) 2018-01-04 19:45:35 +05:30
Lorenzo Sciandra
260779424d removing react-addons-test-utils (#3221) 2018-01-04 14:08:58 +00:00
Brent Vatne
85a6b131d9 Fix example project 2017-12-20 13:35:35 -08:00
Nicolas Charpentier
5824866ef0 Update Contributors Guide link (#3133) 2017-12-15 11:37:31 -05:00
Flo
8462821dd7 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 16:01:35 +01:00