mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Added ColorPropType
Summary: Problem: https://github.com/facebook/react-native/issues/4708 Solution: Added a ColorPropType that validates the color used by the dev Notes: 1) I'm working a Win8.1 machine and couldn't build the react-native using the github repo. As soon as I figure that out, I'll probably figure how to run the tests and how to add some for this feature. 2) It's my first pull request. Be gentle :) Closes https://github.com/facebook/react-native/pull/4866 Reviewed By: bestander, svcscm Differential Revision: D2783672 Pulled By: nicklockwood fb-gh-sync-id: ca22aa3c0999188075681b5d20fff0631496e238
This commit is contained in:
committed by
facebook-github-bot-3
parent
7164c755cb
commit
a162f72655
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const ColorPropType = require('ColorPropType');
|
||||
const EdgeInsetsPropType = require('EdgeInsetsPropType');
|
||||
const Image = require('Image');
|
||||
const NativeMethodsMixin = require('NativeMethodsMixin');
|
||||
@@ -166,10 +167,7 @@ const MapView = React.createClass({
|
||||
* are supported for regular pins. For custom pin images, any tintColor
|
||||
* value is supported on all iOS versions.
|
||||
*/
|
||||
tintColor: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number
|
||||
]),
|
||||
tintColor: ColorPropType,
|
||||
|
||||
/**
|
||||
* Custom pin image. This must be a static image resource inside the app.
|
||||
@@ -213,14 +211,8 @@ const MapView = React.createClass({
|
||||
* Line attributes
|
||||
*/
|
||||
lineWidth: React.PropTypes.number,
|
||||
strokeColor: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number
|
||||
]),
|
||||
fillColor: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number
|
||||
]),
|
||||
strokeColor: ColorPropType,
|
||||
fillColor: ColorPropType,
|
||||
|
||||
/**
|
||||
* Overlay id
|
||||
|
||||
Reference in New Issue
Block a user