2015-02-20 04:10:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* @providesModule ImageStylePropTypes
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var ImageResizeMode = require('ImageResizeMode');
|
|
|
|
var LayoutPropTypes = require('LayoutPropTypes');
|
|
|
|
var ReactPropTypes = require('ReactPropTypes');
|
|
|
|
|
2015-03-20 23:41:31 +00:00
|
|
|
var ImageStylePropTypes = {
|
|
|
|
...LayoutPropTypes,
|
|
|
|
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
|
|
|
|
backgroundColor: ReactPropTypes.string,
|
|
|
|
borderColor: ReactPropTypes.string,
|
|
|
|
borderWidth: ReactPropTypes.number,
|
|
|
|
borderRadius: ReactPropTypes.number,
|
2015-02-20 04:10:52 +00:00
|
|
|
|
2015-03-20 23:41:31 +00:00
|
|
|
// 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,
|
|
|
|
};
|
2015-02-20 04:10:52 +00:00
|
|
|
|
|
|
|
// 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;
|