Commit Graph

21 Commits

Author SHA1 Message Date
Mats Byrkeland edb6ca72fd Fix ESLint warnings using 'yarn lint --fix'
Summary:
Hi! I would like to contribute to React Native, and I am just starting out. I forked the repo and found that it has quite a lot of ESLint warnings – many of which were automatically fixable. This PR is simply the result of running `yarn lint --fix` from the root folder.

Most changes are removing trailing spaces from comments.

Haven't really done any manual testing, since I haven't done any code changes manually. `yarn test` runs fine, `yarn flow` runs fine, `yarn prettier` is satisfied.

N/A

[INTERNAL][MINOR][] - Fix ESLint warnings
Closes https://github.com/facebook/react-native/pull/18047

Differential Revision: D7054948

Pulled By: hramos

fbshipit-source-id: d53e692698d1687de5821c3fb5cdb76a5e03b71e
2018-02-22 07:23:17 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Peter van der Zee 6893a26bfb Fix duplicate var name declaration
Reviewed By: rafeca

Differential Revision: D6965150

fbshipit-source-id: 332c8202f350e2014fedb9790f3d895222fb4f8d
2018-02-13 01:49:56 -08:00
Héctor Ramos 79e24ede40 Migrate additional docs to the new format
Summary:
[DOCS]
Closes https://github.com/facebook/react-native/pull/16874

Differential Revision: D6375515

Pulled By: hramos

fbshipit-source-id: 64359b45a37c7b478919121573ca04dbb1ce6609
2017-11-20 13:16:12 -08:00
Jessica Cao 780938170b Backed out changeset eadb184eacdf
Reviewed By: fkgozali, hramos

Differential Revision: D6287083

fbshipit-source-id: 43c6e43a9d5411e71f51824f9443559b4e0a47e2
2017-11-09 12:57:14 -08:00
Jessica Cao 2be3ae1ff2 Add ?Fbt to flow type for the title & message props
Differential Revision: D6253195

fbshipit-source-id: eadb185eacdf341393d73357beab22bed1d0169e
2017-11-06 16:24:22 -08:00
Wei Yeh e0202e459f Fix a few more Flow warnings
Differential Revision: D6236901

fbshipit-source-id: d98c46cce83ddb45d7f9139d981595eaaeeff933
2017-11-05 12:07:46 -08:00
Lincoln Hochberg d726c2c8ca support null titles in AlertIOS
Reviewed By: achen1

Differential Revision: D5807055

fbshipit-source-id: f79579d4cffb9792f49f89a7fb8f7df8e082a3a9
2017-09-11 16:08:03 -07:00
Wes Johnson a64674375e Alert - allow for hiding alert title on iOS
Summary:
Wanted a "message-only" alert on iOS that doesn't lead to the message being large & bolded via the title field (current state).

Before:

![screen shot 2017-08-28 at 9 22 04 pm](https://user-images.githubusercontent.com/1047502/29801514-fc3629d2-8c3d-11e7-86d5-f0a866301814.png)

After:

![screen shot 2017-08-28 at 9 26 56 pm](https://user-images.githubusercontent.com/1047502/29801521-071aa1ca-8c3e-11e7-9bd0-0a4682d81979.png)

It also aligns iOS with Android's current behaviour.

The above screenhots were generated from the `RNTester` example added herein.

Allowed for passing an empty string through to `UIAlertController.alertControllerWithTitle` so that the message could be rendered in its expected place on iOS (not as the title).

* Ran RNTester & compared example alerts before & after (below default with titles, for example)
* Ran end-to-end manual test suite (it's the only one I could get through without unrelated failures)

Before

![screen shot 2017-08-28 at 9 21 53 pm](https://user-images.githubusercontent.com/1047502/29801775-6e249ff0-8c3f-11e7-888b-2c4d5177a7d7.png)

After

![screen shot 2017-08-28 at 9 26 40 pm](https://user-images.githubusercontent.com/1047502/29801781-7270c4a8-8c3f-11e7-8b9b-59b2649646f2.png)
Closes https://github.com/facebook/react-native/pull/15685

Differential Revision: D5729420

Pulled By: hramos

fbshipit-source-id: 4866b0b24473ae35e9ebae09f2cee13a49d7717e
2017-08-30 17:16:17 -07:00
Valentin Shergin 4e437c1232 Export Alert's type ButtonsArray for external use
Reviewed By: mmmulani

Differential Revision: D4623764

fbshipit-source-id: 9c4edc98e15603bdae180ec4b6c27b677bba1d53
2017-03-06 12:44:47 -08:00
Benjamin Dobell 27928f3993 Optional Alert onDismiss callback to support Android default behavior
Summary:
On Android it's generally expected that alerts are dismissible by tapping outside the alert box. This is the default behavior for React Native, but until now there has been no means to listen for the dismiss event.

`Alert.alert` already takes an `options` object, so this pull request simply adds an additional option `onDismiss`, a callback function that will be called when an Alert is dismissed (rather than being closed as a result of a button press).

**Test plan**

Simply pass an `options` object to `Alert.alert` with the `onDismiss` property set to a function.

e.g. Run the following on Android, dismiss the alert by tapping outside the alert view, and monitor console output.

```
Alert.alert(
  'Alert Title',
  'My Alert Msg',
  [
    {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
    {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
    {text: 'OK', onPress: () => console.log('OK Pressed')},
  ],
  { onDismiss: () => console.
Closes https://github.com/facebook/react-native/pull/12594

Differential Revision: D4619862

Pulled By: ericvicenti

fbshipit-source-id: fdd351a7b8e673dab331f0e22dc5ea2e84f24375
2017-02-27 14:04:57 -08:00
Guy Rosenmann 72ddfb014a fix inline NativeModule typo
Reviewed By: javache

Differential Revision: D4590904

fbshipit-source-id: 110f8d4d3efa72ba26b80277c321cb1d7a40540c
2017-02-21 10:04:42 -08:00
Aaron Chiu 1fa95ed390 inline a bunch of NativeModule requires
Reviewed By: shergin

Differential Revision: D4578180

fbshipit-source-id: 3764ffd32eb7e4698e928740bc72bbad02876894
2017-02-17 16:49:38 -08:00
Paul Mestemaker 8378f0f9f7 Ensure documentation has consistent relative links
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

I had tried fixing a broken link in a previous commit (#11453). My commit was merged, but it did not resolve the underlying problem. I have looked into how links should be formed for the docs and have fixed the original problem as well as updated all other links to be consistent.

Previous link formats:

- /docs/sample.html <-- broken link
- sample.html <-- broken link
- https://facebook.github.io/react-native/docs/sample.html <-- works
- /react-native/docs/sample.html <-- works
- docs/sample.html <-- works (permalink format)

This PR updates all links to the permalink format.

**Test plan (required)**
I ran the website locally and manually tested half of the links in each category. They all worked.
```
$ cd website
$ npm install && npm start
```
Closes https://github.com/facebook/react-native/pull/12064

Differential Revision: D4489153

Pulled By: mkonicek

fbshipit-source-id: bf0231d941ba147317595c3b3466dc579a887169
2017-01-31 12:13:31 -08:00
yueshuaijie 94f71a3884 Add one more parameter(keyboardType) to AlertIOS.promot().
Summary:
Add one more parameter which can specify the keyboard type of first text input(if exists) to AlertIOS.prompt().

Example usage:
`AlertIOS.prompt('Type a phone number', null, null, 'plain-text', undefined, 'phone-pad')`
Closes https://github.com/facebook/react-native/pull/8781

Differential Revision: D4437900

Pulled By: hramos

fbshipit-source-id: 8141cc0d7c70d13603cd5a1d5ea3f1ab1ce437a6
2017-01-19 14:43:37 -08:00
Gabe Levi 6ffdd1678e Fix all the flow errors
Reviewed By: bestander

Differential Revision: D4435405

fbshipit-source-id: 888c94e7984d3ca926a4b08b1e3dafe9a2474491
2017-01-19 04:43:38 -08:00
Gabe Levi a4bfac907e Deploy v0.38.0
Reviewed By: jeffmo

Differential Revision: D4428858

fbshipit-source-id: 10dc69349a2b563e1fa444a8b0612e3b2d4ccd1c
2017-01-18 11:13:30 -08:00
Paul Mestemaker fa3c06d637 Update AlertIOS.js
Summary:
This fixes a broken link in the docs.
Closes https://github.com/facebook/react-native/pull/11453

Differential Revision: D4394773

Pulled By: lacker

fbshipit-source-id: 07b3aaa25017912063ac9e65f336c56a902d7144
2017-01-09 15:28:31 -08:00
Kevin Lacker 9f3ef48f65 Added info about a cancelable option for Alerts on Android.
Summary:
In the 8e2906ae89 commit there was implemented a cancelable option for Alerts. It wasn't clear from the docs about this option and the additional Alert method's parameter.
Closes https://github.com/facebook/react-native/pull/11292

Differential Revision: D4342707

Pulled By: lacker

fbshipit-source-id: dc243b868106e705040e77bc90d4d9b8c2dc26eb
2016-12-16 16:28:31 -08:00
kevyu的马甲 beca25083a fix typo in Alert.js
Summary:
after adding new parameter options in alert method, parameter type is the 5th.
Closes https://github.com/facebook/react-native/pull/10370

Differential Revision: D4021511

Pulled By: javache

fbshipit-source-id: 09476162b879d2081f0c0ac95260e673327871b8
2016-10-14 08:13:55 -07:00
Pieter De Baets 292cc82d0e Reorganize core JS files
Reviewed By: lexs

Differential Revision: D3987463

fbshipit-source-id: fa8f1d1bea7ed699120b9705ddc1c83767fcf8e4
2016-10-11 10:14:28 -07:00