Kaynağa Gözat

Add missing modal options documentation + a few fixes

Guy Carmeli 4 yıl önce
ebeveyn
işleme
5314a3e586
2 değiştirilmiş dosya ile 26 ekleme ve 3 silme
  1. 7
    3
      website/api/api-events.mdx
  2. 19
    0
      website/api/options-modal.mdx

+ 7
- 3
website/api/api-events.mdx Dosyayı Görüntüle

@@ -151,6 +151,11 @@ const modalDismissedListener = Navigation.events().registerModalDismissedListene
151 151
 modalDismissedListener.remove();
152 152
 ```
153 153
 
154
+|      Parameter      | Description                          |
155
+| :-----------------: | :----------------------------------- |
156
+|   **componentId**   | Id of the modal                      |
157
+| **modalsDismissed** | Number of modals that were dismissed |
158
+
154 159
 ## registerModalAttemptedToDismissListener(iOS 13+ only)
155 160
 
156 161
 Invoked only on iOS pageSheet modal when `swipeToDismiss` flag is set to true and modal was swiped down to dismiss.
@@ -162,7 +167,7 @@ const modalAttemptedToDismissListener = Navigation.events().registerModalAttempt
162 167
 });
163 168
 ...
164 169
 // Unsubscribe
165
-modalDismissedListener.remove();
170
+modalAttemptedToDismissListener.remove();
166 171
 ```
167 172
 
168 173
 |    Parameter    | Description                      |
@@ -185,8 +190,7 @@ screenPoppedListener.remove();
185 190
 
186 191
 |      Parameter      | Description                          |
187 192
 | :-----------------: | :----------------------------------- |
188
-|   **componentId**   | Id of the modal                      |
189
-| **modalsDismissed** | Number of modals that were dismissed |
193
+|   **componentId**   | Id of the screen which was popped    |
190 194
 
191 195
 ## registerBottomTabSelectedListener
192 196
 

+ 19
- 0
website/api/options-modal.mdx Dosyayı Görüntüle

@@ -0,0 +1,19 @@
1
+---
2
+id: options-modal
3
+title: Modal Options
4
+sidebar_label: Modal
5
+---
6
+
7
+```js
8
+const options = {
9
+  swipeToDismiss
10
+};
11
+```
12
+
13
+## `swipeToDismiss`
14
+
15
+Control wether this modal should be dismiss using swipe gesture when the `modalPresentationStyle` is `pageSheet`
16
+
17
+| Type                                  | Required | Platform |  Default |
18
+| ------------------------------------- | -------- | -------- | -------- |
19
+| boolean                               | No       | Both     | true     |