|
@@ -1,4 +1,4 @@
|
1
|
|
-# Top Level API Migration
|
|
1
|
+# Top Level API
|
2
|
2
|
|
3
|
3
|
In order to make navigation API homogenous as much as possible, we provide setRoot function that receives layout of any kind.
|
4
|
4
|
See [Layout types](layout-types)
|
|
@@ -47,71 +47,31 @@ Navigation.setRoot({
|
47
|
47
|
});
|
48
|
48
|
```
|
49
|
49
|
|
50
|
|
-## showModal(layout = {})
|
|
50
|
+## showOverlay(layout = {})
|
51
|
51
|
|
52
|
|
-Show a screen as a modal.
|
|
52
|
+Show component as overlay.
|
53
|
53
|
|
54
|
54
|
```js
|
55
|
|
-Navigation.showModal({
|
56
|
|
- stack: {
|
57
|
|
- children: [{
|
58
|
|
- component: {
|
59
|
|
- name: 'example.ModalScreen',
|
60
|
|
- passProps: {
|
61
|
|
- text: 'stack with one child'
|
62
|
|
- },
|
63
|
|
- options: {
|
64
|
|
- topBar: {
|
65
|
|
- title: {
|
66
|
|
- text: 'Modal with stack'
|
67
|
|
- }
|
68
|
|
- }
|
69
|
|
- }
|
|
55
|
+Navigation.showOverlay({
|
|
56
|
+ component: {
|
|
57
|
+ name: 'example.Overlay',
|
|
58
|
+ options: {
|
|
59
|
+ overlay: {
|
|
60
|
+ interceptTouchOutside: true
|
70
|
61
|
}
|
71
|
|
- }]
|
|
62
|
+ }
|
72
|
63
|
}
|
73
|
64
|
});
|
74
|
65
|
```
|
75
|
66
|
|
76
|
|
-## dismissModal(componentId)
|
|
67
|
+## dismissOverlay(componentId)
|
77
|
68
|
|
78
|
|
-Dismiss the current modal.
|
|
69
|
+Dismiss overlay matching the overlay componentId.
|
79
|
70
|
|
80
|
71
|
```js
|
81
|
|
-Navigation.dismissModal(this.props.componentId);
|
|
72
|
+Navigation.dismissOverlay(this.props.componentId);
|
82
|
73
|
```
|
83
|
74
|
|
84
|
|
-## dismissAllModals()
|
85
|
|
-
|
86
|
|
-Dismiss all the current modals at the same time.
|
87
|
|
-
|
88
|
|
-```js
|
89
|
|
-Navigation.dismissAllModals();
|
90
|
|
-```
|
91
|
|
-
|
92
|
|
-<!-- ## showLightBox(params = {}) - Use showOverlay
|
93
|
|
-
|
94
|
|
-Show a screen as a lightbox.
|
95
|
|
-
|
96
|
|
-```js
|
97
|
|
-Navigation.showLightBox({
|
98
|
|
- screen: 'example.LightBoxScreen', // unique ID registered with Navigation.registerScreen
|
99
|
|
- passProps: {}, // simple serializable object that will pass as props to the lightbox (optional)
|
100
|
|
- style: {
|
101
|
|
- backgroundBlur: 'dark', // 'dark' / 'light' / 'xlight' / 'none' - the type of blur on the background
|
102
|
|
- backgroundColor: '#ff000080', // tint color for the background, you can specify alpha here (optional)
|
103
|
|
- tapBackgroundToDismiss: true // dismisses LightBox on background taps (optional)
|
104
|
|
- }
|
105
|
|
-});
|
106
|
|
-``` -->
|
107
|
|
-
|
108
|
|
-<!-- ## dismissLightBox(params = {})
|
109
|
|
-
|
110
|
|
-Dismiss the current lightbox.
|
111
|
|
-
|
112
|
|
-```js
|
113
|
|
-Navigation.dismissLightBox();
|
114
|
|
-``` -->
|
115
|
75
|
|
116
|
76
|
<!-- ## handleDeepLink(params = {})
|
117
|
77
|
|