Skip to content

Commit bb2e334

Browse files
committed
Cap comments to 80 characters and add annotations
1 parent 627286d commit bb2e334

1 file changed

Lines changed: 33 additions & 20 deletions

File tree

Libraries/Modal/Modal.js

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*
77
* @format
88
* @flow
9+
* @generate-docs
910
*/
1011

1112
'use strict';
@@ -45,19 +46,23 @@ export type Props = $ReadOnly<{|
4546
- `fade` fades into view
4647
- `none` appears without an animation
4748
48-
Default is set to `none`.
49+
@default none
4950
*/
5051
animationType?: ?('none' | 'slide' | 'fade'),
5152

5253
/**
53-
The `presentationStyle` prop controls how the modal appears (generally on larger devices such as iPad or plus-sized iPhones). See https://developer.apple.com/reference/uikit/uimodalpresentationstyle for details.
54+
The `presentationStyle` prop controls how the modal appears (generally on
55+
larger devices such as iPad or plus-sized iPhones). See
56+
https://developer.apple.com/reference/uikit/uimodalpresentationstyle for
57+
details.
5458
5559
- `fullScreen` covers the screen completely
5660
- `pageSheet` covers portrait-width view centered (only on larger devices)
5761
- `formSheet` covers narrow-width view centered (only on larger devices)
5862
- `overFullScreen` covers the screen completely, but allows transparency
5963
60-
Default is set to `overFullScreen` or `fullScreen` depending on `transparent` property.
64+
Default is set to `overFullScreen` or `fullScreen` depending on
65+
`transparent` property.
6166
6267
@platform ios
6368
*/
@@ -69,20 +74,23 @@ export type Props = $ReadOnly<{|
6974
),
7075

7176
/**
72-
The `transparent` prop determines whether your modal will fill the entire view.
73-
Setting this to `true` will render the modal over a transparent background.
77+
The `transparent` prop determines whether your modal will fill the entire
78+
view. Setting this to `true` will render the modal over a transparent
79+
background.
7480
*/
7581
transparent?: ?boolean,
7682

7783
/**
78-
The `statusBarTranslucent` prop determines whether your modal should go under the system statusbar.
84+
The `statusBarTranslucent` prop determines whether your modal should go
85+
under the system statusbar.
7986
8087
@platform android
8188
*/
8289
statusBarTranslucent?: ?boolean,
8390

8491
/**
85-
The `hardwareAccelerated` prop controls whether to force hardware acceleration for the underlying window.
92+
The `hardwareAccelerated` prop controls whether to force hardware
93+
acceleration for the underlying window.
8694
8795
@platform android
8896
*/
@@ -94,9 +102,10 @@ export type Props = $ReadOnly<{|
94102
visible?: ?boolean,
95103

96104
/**
97-
The `onRequestClose` callback is called when the user taps the hardware back button on Android
98-
or the menu button on Apple TV. Because of this required prop, be aware that `BackHandler`
99-
events will not be emitted as long as the modal is open.
105+
The `onRequestClose` callback is called when the user taps the hardware back
106+
button on Android or the menu button on Apple TV. Because of this required
107+
prop, be aware that `BackHandler` events will not be emitted as long as the
108+
modal is open.
100109
101110
| Type | Required | Platform |
102111
| -------- | -------- | ------------------------ |
@@ -106,22 +115,25 @@ export type Props = $ReadOnly<{|
106115
onRequestClose?: ?DirectEventHandler<null>,
107116

108117
/**
109-
The `onShow` prop allows passing a function that will be called once the modal has been shown.
118+
The `onShow` prop allows passing a function that will be called once the
119+
modal has been shown.
110120
*/
111121
onShow?: ?DirectEventHandler<null>,
112122

113123
/**
114-
The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.
124+
The `onDismiss` prop allows passing a function that will be called once the
125+
modal has been dismissed.
115126
116127
@platform ios
117128
*/
118129
onDismiss?: ?() => mixed,
119130

120131
/**
121-
The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations.
122-
On iOS, the modal is still restricted by what's specified in your app's Info.plist's
123-
UISupportedInterfaceOrientations field. When using `presentationStyle` of `pageSheet`
124-
or `formSheet`, this property will be ignored by iOS.
132+
The `supportedOrientations` prop allows the modal to be rotated to any of
133+
the specified orientations. On iOS, the modal is still restricted by what's
134+
specified in your app's Info.plist's UISupportedInterfaceOrientations field.
135+
When using `presentationStyle` of `pageSheet` or `formSheet`, this property
136+
will be ignored by iOS.
125137
126138
@platform ios
127139
*/
@@ -134,8 +146,9 @@ export type Props = $ReadOnly<{|
134146
>,
135147

136148
/**
137-
The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed.
138-
The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render,
149+
The `onOrientationChange` callback is called when the orientation changes
150+
while the modal is being displayed. The orientation provided is only
151+
'portrait' or 'landscape'. This callback is also called on initial render,
139152
regardless of the current orientation.
140153
141154
@platform ios
@@ -146,7 +159,7 @@ export type Props = $ReadOnly<{|
146159
/**
147160
The Modal component is a basic way to present content above an enclosing view.
148161
149-
@example ```SnackPlayer name=Modal&supportedPlatforms=android,ios
162+
```SnackPlayer name=Modal%20Function%20Component%20Example&supportedPlatforms=android,ios
150163
import React, { useState } from "react";
151164
import {
152165
Alert,
@@ -239,7 +252,7 @@ export type Props = $ReadOnly<{|
239252
export default App;
240253
```
241254
242-
@example ```SnackPlayer name=Modal&supportedPlatforms=android,ios
255+
```SnackPlayer name=Modal%20Class%20Component%20Example&supportedPlatforms=android,ios
243256
import React, { Component } from "react";
244257
import {
245258
Alert,

0 commit comments

Comments
 (0)