Updates from Wed Mar 4

- [react-packager] Start converting options to query params | Amjad Masad
- [ReactNative] Replace js long constants with strings | Tadeu Zagallo
- React Native: Remove Unnecessary `document.body` Shim | Tim Yung
- [ReactNative] Use spread operator and .propTypes for ScrollView/ListView | Christopher Chedeau
This commit is contained in:
Christopher Chedeau
2015-03-04 21:06:49 -08:00
parent b9ab607197
commit b87ba87e47
15 changed files with 212 additions and 221 deletions

View File

@@ -6,7 +6,7 @@
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModulesDeprecated = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var PropTypes = require('ReactPropTypes');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
@@ -37,12 +37,11 @@ var ActivityIndicatorIOS = React.createClass({
* The foreground color of the spinner (default is gray).
*/
color: PropTypes.string,
/**
* The size of the spinner, must be one of:
* - ActivityIndicatorIOS.size.large
* - ActivityIndicatorIOS.size.small (default)
*/
size: PropTypes.oneOf([SpinnerSize.large, SpinnerSize.small]),
size: PropTypes.oneOf([
'small', // default
'large',
]),
},
getDefaultProps: function() {
@@ -53,15 +52,11 @@ var ActivityIndicatorIOS = React.createClass({
};
},
statics: {
size: SpinnerSize,
},
render: function() {
var style = styles.sizeSmall;
var NativeConstants = NativeModulesDeprecated.RKUIManager.UIActivityIndicatorView.Constants;
var NativeConstants = NativeModules.RKUIManager.UIActivityIndicatorView.Constants;
var activityIndicatorViewStyle = NativeConstants.StyleWhite;
if (this.props.size == SpinnerSize.large) {
if (this.props.size === 'large') {
style = styles.sizeLarge;
activityIndicatorViewStyle = NativeConstants.StyleWhiteLarge;
}