[ReactNative] Pull transform properties out into TransformPropTypes

This commit is contained in:
Peter Zich 2015-05-06 14:28:05 -07:00
parent 40e3f6ea8c
commit d177a45bdc
3 changed files with 32 additions and 9 deletions

View File

@ -13,12 +13,14 @@
var LayoutPropTypes = require('LayoutPropTypes');
var ReactPropTypes = require('ReactPropTypes');
var TransformPropTypes = require('TransformPropTypes');
/**
* Warning: Some of these properties may not be supported in all releases.
*/
var ViewStylePropTypes = {
...LayoutPropTypes,
...TransformPropTypes,
backgroundColor: ReactPropTypes.string,
borderColor: ReactPropTypes.string,
borderTopColor: ReactPropTypes.string,
@ -34,15 +36,6 @@ var ViewStylePropTypes = {
),
shadowOpacity: ReactPropTypes.number,
shadowRadius: ReactPropTypes.number,
transform: ReactPropTypes.arrayOf(ReactPropTypes.object),
transformMatrix: ReactPropTypes.arrayOf(ReactPropTypes.number),
// DEPRECATED
rotation: ReactPropTypes.number,
scaleX: ReactPropTypes.number,
scaleY: ReactPropTypes.number,
translateX: ReactPropTypes.number,
translateY: ReactPropTypes.number,
};
module.exports = ViewStylePropTypes;

View File

@ -14,9 +14,11 @@
var ImageResizeMode = require('ImageResizeMode');
var LayoutPropTypes = require('LayoutPropTypes');
var ReactPropTypes = require('ReactPropTypes');
var TransformPropTypes = require('TransformPropTypes');
var ImageStylePropTypes = {
...LayoutPropTypes,
...TransformPropTypes,
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
backgroundColor: ReactPropTypes.string,
borderColor: ReactPropTypes.string,

View File

@ -0,0 +1,28 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule TransformPropTypes
* @flow
*/
'use strict';
var ReactPropTypes = require('ReactPropTypes');
var TransformPropTypes = {
transform: ReactPropTypes.arrayOf(ReactPropTypes.object),
transformMatrix: ReactPropTypes.arrayOf(ReactPropTypes.number),
// DEPRECATED
rotation: ReactPropTypes.number,
scaleX: ReactPropTypes.number,
scaleY: ReactPropTypes.number,
translateX: ReactPropTypes.number,
translateY: ReactPropTypes.number,
};
module.exports = TransformPropTypes;