Commit Graph

13 Commits

Author SHA1 Message Date
dlowder-salesforce c1223c5530 Apple TV: TouchableOpacity and Button need hasTVPreferredFocus support
Summary:
**Motivation**

Give `TouchableOpacity` and `Button` the same TV focus support as is already present in `TouchableHighlight`.

**Test plan**

Manual testing on TV simulator and devices.
Closes https://github.com/facebook/react-native/pull/15561

Differential Revision: D5665976

Pulled By: hramos

fbshipit-source-id: 0d5c588e1c82471f23617a3df1b77abc589a7c63
2017-10-18 12:18:12 -07:00
Nicholas Juntilla 70558b9e70 Add the import statement to examples
Summary:
As a new user it took me a while to figure out you can import these examples directly. The import statement completes the example for new users like me who have no idea these components can be imported. It is a very important piece of information and it is hard to find otherwise.

I think this should be added to all the other component examples as well.

Documentation only.
Closes https://github.com/facebook/react-native/pull/15501

Differential Revision: D5882436

Pulled By: hramos

fbshipit-source-id: 2da0fe4c7c41e2fdb6b13a945460e17e16442d62
2017-09-21 12:31:37 -07:00
Caleb Meredith 90eaeb019b Upgrade fbsource/xplat/js to Flow v0.53.0
Reviewed By: avikchaudhuri

Differential Revision:
D5648819
Ninja: T20988071

fbshipit-source-id: 66e5b6747c79ae66b6eb69d40ede5e982c26174f
2017-08-17 18:45:01 -07:00
Dapeng Gao 7ee051db28 Clearer code in Button.js
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
* Combined repeating `if` checks for clearer logic.
* `defaultBlue` is inlined because it is only used once for each OS.

- Updated the `Button.js` file in an existing project and all buttons behave exactly the same. Here is a simple demo:
  ![](http://i.makeagif.com/media/6-11-2017/B0Bhry.gif)

- There is no change in the underlying logic of the code.
Closes https://github.com/facebook/react-native/pull/14455

Differential Revision: D5330112

Pulled By: hramos

fbshipit-source-id: 7fd1a0609f0bb2123208d0e1b3da2bc779f9583d
2017-06-27 11:33:34 -07:00
Xavier Villelégier f7c89b4187 Update default blue on iOS
Summary:
Hey,

The `defaultBlue` variable is currently `#0C42FD`. We can see that it's not the same as iOS. According to the official Apple website it's supposed to be `#007AFF`.
See the `Blue` color on [this page](https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/)

No code added.
Closes https://github.com/facebook/react-native/pull/14339

Differential Revision: D5199906

Pulled By: hramos

fbshipit-source-id: c06b0081556dddbfe7fecd255eff941cbbfb95ee
2017-06-07 08:47:36 -07:00
Brian Vaughn 6564edce5e Ran PropTypes -> prop-types codemod against Libraries/FBReactKit/js/react-native-github
Reviewed By: acdlite

Differential Revision: D4876709

fbshipit-source-id: 3a5e92bfc74287b7a9054546c438580bed0147af
2017-04-12 16:15:15 -07:00
Andrew Y. Chen b5327dd388 Set the enabled state on disabled button views
Reviewed By: AaaChiuuu

Differential Revision: D4722513

fbshipit-source-id: f4a4e6304594235b5da4e5be36358331e43bdbee
2017-04-06 21:32:05 -07:00
Archit Pal Singh Sachdeva 813f873320 Add disabled to accessibilityTraits in case button is disabled
Reviewed By: javache

Differential Revision: D4593622

fbshipit-source-id: 211f90f6af531a577af4e5487b43a3870f725bff
2017-02-22 13:16:02 -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
Gabriel Reis 5fdd6b33fa Add testID prop to Button component
Summary:
This PR adds the `testID` prop to the `Button` component in order to allow end-to-end tests.
Closes https://github.com/facebook/react-native/pull/11526

Differential Revision: D4392137

Pulled By: ericvicenti

fbshipit-source-id: d3f864aacee319e520af226cd063edef452f6fc8
2017-01-09 02:43:35 -08:00
leeight dbfd046145 Change require('invariant') to require('fbjs/lib/invariant')
Summary:
FIX #10400
Closes https://github.com/facebook/react-native/pull/10409

Differential Revision: D4027850

fbshipit-source-id: c69e2ce892d119847902db3d6689ec237df35332
2016-10-16 02:13:52 -07:00
Timur Gibadullin c32ab7e608 Add disabled prop
Summary:
Implemented feature requested in https://github.com/facebook/react-native/issues/10354, updated docs.
The colours were picked from native interface for iOS and from material-ui for android.
Closes https://github.com/facebook/react-native/pull/10398

Differential Revision: D4026189

Pulled By: ericvicenti

fbshipit-source-id: f3316e76f5a4126c07ffcdfb134cd902f40624d5
2016-10-14 19:43:40 -07:00
Eric Vicenti 2ae73ffa00 Introduce Button Component
Summary:
Button is an important component to help the community get onboarded with RN quickly, so the first few minutes of a developer's experience is not spent formatting a simple button component.

In my opinion, `<Button />` should be seen as a "lowest common demoniator" component, rather than "the one button to rule them all". In other words, we should only support features in Button that will work on any platform. We should encourage people to fork Button if they need to add specific features to it, rather than trying to twist and bloat this component until it supports everything.

These platform imitations may not have the perfect constants just yet, but they are good enough to make a user feel at home in the app, without any modification. The community can help tweak the final formatting to make them look just right- PRs are welcome!

Reviewed By: frantic

Differential Revision: D3929041

fbshipit-source-id: 3785fb67472a7614eeee0a9aef504c0bdf62ede7
2016-10-10 17:28:39 -07:00