From bb2e334d3487f825f9debbce82cc477f84c9f821 Mon Sep 17 00:00:00 2001 From: Ayush Jain Date: Fri, 7 Aug 2020 19:47:47 +0530 Subject: [PATCH] Cap comments to 80 characters and add annotations --- Libraries/Modal/Modal.js | 53 +++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index bcc0f140d3b54b..e3c8889a3a40b5 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -6,6 +6,7 @@ * * @format * @flow + * @generate-docs */ 'use strict'; @@ -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 */ @@ -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 */ @@ -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 | | -------- | -------- | ------------------------ | @@ -106,22 +115,25 @@ export type Props = $ReadOnly<{| onRequestClose?: ?DirectEventHandler, /** - 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, /** - 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 */ @@ -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 @@ -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, @@ -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,