Skip to content

Commit

Permalink
Cap comments to 80 characters and add annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushjainrksh committed Aug 7, 2020
1 parent 627286d commit bb2e334
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions Libraries/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @format
* @flow
* @generate-docs
*/

'use strict';
Expand Down Expand Up @@ -45,19 +46,23 @@ export type Props = $ReadOnly<{|
- `fade` fades into view
- `none` appears without an animation
Default is set to `none`.
@default none
*/
animationType?: ?('none' | 'slide' | 'fade'),

/**
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.
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.
- `fullScreen` covers the screen completely
- `pageSheet` covers portrait-width view centered (only on larger devices)
- `formSheet` covers narrow-width view centered (only on larger devices)
- `overFullScreen` covers the screen completely, but allows transparency
Default is set to `overFullScreen` or `fullScreen` depending on `transparent` property.
Default is set to `overFullScreen` or `fullScreen` depending on
`transparent` property.
@platform ios
*/
Expand All @@ -69,20 +74,23 @@ export type Props = $ReadOnly<{|
),

/**
The `transparent` prop determines whether your modal will fill the entire view.
Setting this to `true` will render the modal over a transparent background.
The `transparent` prop determines whether your modal will fill the entire
view. Setting this to `true` will render the modal over a transparent
background.
*/
transparent?: ?boolean,

/**
The `statusBarTranslucent` prop determines whether your modal should go under the system statusbar.
The `statusBarTranslucent` prop determines whether your modal should go
under the system statusbar.
@platform android
*/
statusBarTranslucent?: ?boolean,

/**
The `hardwareAccelerated` prop controls whether to force hardware acceleration for the underlying window.
The `hardwareAccelerated` prop controls whether to force hardware
acceleration for the underlying window.
@platform android
*/
Expand All @@ -94,9 +102,10 @@ export type Props = $ReadOnly<{|
visible?: ?boolean,

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

/**
The `onShow` prop allows passing a function that will be called once the modal has been shown.
The `onShow` prop allows passing a function that will be called once the
modal has been shown.
*/
onShow?: ?DirectEventHandler<null>,

/**
The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.
The `onDismiss` prop allows passing a function that will be called once the
modal has been dismissed.
@platform ios
*/
onDismiss?: ?() => mixed,

/**
The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations.
On iOS, the modal is still restricted by what's specified in your app's Info.plist's
UISupportedInterfaceOrientations field. When using `presentationStyle` of `pageSheet`
or `formSheet`, this property will be ignored by iOS.
The `supportedOrientations` prop allows the modal to be rotated to any of
the specified orientations. On iOS, the modal is still restricted by what's
specified in your app's Info.plist's UISupportedInterfaceOrientations field.
When using `presentationStyle` of `pageSheet` or `formSheet`, this property
will be ignored by iOS.
@platform ios
*/
Expand All @@ -134,8 +146,9 @@ export type Props = $ReadOnly<{|
>,

/**
The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed.
The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render,
The `onOrientationChange` callback is called when the orientation changes
while the modal is being displayed. The orientation provided is only
'portrait' or 'landscape'. This callback is also called on initial render,
regardless of the current orientation.
@platform ios
Expand All @@ -146,7 +159,7 @@ export type Props = $ReadOnly<{|
/**
The Modal component is a basic way to present content above an enclosing view.
@example ```SnackPlayer name=Modal&supportedPlatforms=android,ios
```SnackPlayer name=Modal%20Function%20Component%20Example&supportedPlatforms=android,ios
import React, { useState } from "react";
import {
Alert,
Expand Down Expand Up @@ -239,7 +252,7 @@ export type Props = $ReadOnly<{|
export default App;
```
@example ```SnackPlayer name=Modal&supportedPlatforms=android,ios
```SnackPlayer name=Modal%20Class%20Component%20Example&supportedPlatforms=android,ios
import React, { Component } from "react";
import {
Alert,
Expand Down

0 comments on commit bb2e334

Please sign in to comment.