mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-27 22:54:46 +08:00
Updates from Fri Feb 27
- [react-packager] transformModulePath option is not actually required | Amjad Masad - Implement TextInput.clearButtonMode added by D1875684 on OSS fork + example | Tadeu Zagallo - [ReactNative] Use local CocoaPod config for ReactNative modules | Spencer Ahrens - [ReactNative] Pull out some OSS modules into separate libs | Spencer Ahrens - Enqueue events at 60fps + profiling helpers | Tadeu Zagallo
This commit is contained in:
45
Libraries/Image/ImageStylePropTypes.js
Normal file
45
Libraries/Image/ImageStylePropTypes.js
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook. All Rights Reserved.
|
||||
*
|
||||
* @providesModule ImageStylePropTypes
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ImageResizeMode = require('ImageResizeMode');
|
||||
var LayoutPropTypes = require('LayoutPropTypes');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var merge = require('merge');
|
||||
|
||||
var ImageStylePropTypes = merge(
|
||||
LayoutPropTypes,
|
||||
{
|
||||
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
|
||||
backgroundColor: ReactPropTypes.string,
|
||||
borderColor: ReactPropTypes.string,
|
||||
borderWidth: ReactPropTypes.number,
|
||||
borderRadius: ReactPropTypes.number,
|
||||
|
||||
// iOS-Specific style to "tint" an image.
|
||||
// It changes the color of all the non-transparent pixels to the tintColor
|
||||
tintColor: ReactPropTypes.string,
|
||||
opacity: ReactPropTypes.number,
|
||||
}
|
||||
);
|
||||
|
||||
// Image doesn't support padding correctly (#4841912)
|
||||
var unsupportedProps = Object.keys({
|
||||
padding: null,
|
||||
paddingTop: null,
|
||||
paddingLeft: null,
|
||||
paddingRight: null,
|
||||
paddingBottom: null,
|
||||
paddingVertical: null,
|
||||
paddingHorizontal: null,
|
||||
});
|
||||
|
||||
for (var key in unsupportedProps) {
|
||||
delete ImageStylePropTypes[key];
|
||||
}
|
||||
|
||||
module.exports = ImageStylePropTypes;
|
||||
Reference in New Issue
Block a user