2015-04-14 05:10:00 +00:00
|
|
|
/**
|
|
|
|
* @providesModule LinearGradient
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2015-09-29 16:43:22 +00:00
|
|
|
var React = require('react-native');
|
2015-12-07 18:15:01 +00:00
|
|
|
var { requireNativeComponent, processColor, View } = React;
|
2015-09-29 16:43:22 +00:00
|
|
|
var NativeLinearGradient = requireNativeComponent('BVLinearGradient', null);
|
|
|
|
|
|
|
|
var LinearGradient = React.createClass({
|
2015-12-07 18:15:01 +00:00
|
|
|
propTypes: {
|
|
|
|
...View.propTypes,
|
|
|
|
},
|
|
|
|
|
2015-09-29 16:43:22 +00:00
|
|
|
render: function() {
|
|
|
|
var { colors, ...otherProps } = this.props;
|
|
|
|
return (
|
|
|
|
<NativeLinearGradient {...otherProps} colors={colors.map(processColor)} />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
2015-03-31 17:44:16 +00:00
|
|
|
|
|
|
|
module.exports = LinearGradient;
|