-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNativeLinearGradient.js
More file actions
39 lines (36 loc) · 1003 Bytes
/
NativeLinearGradient.js
File metadata and controls
39 lines (36 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React, {
Component,
StyleSheet,
processColor,
requireNativeComponent,
PropTypes,
View,
} from 'react-native';
class LinearGradient extends Component {
constructor(props) {
super(props);
this.state= {
count: 0,
colorTop: '#000000',
colorBottom: '#cccccc',
};
}
render() {
var { style, children, colors, locations, start, end } = this.props;
// Children is an array of components
return (
<View style={style}>
<NativeLinearGradient
style={{position: 'absolute', top: 0, left: 0, bottom: 0, right: 0}}
colors={colors.map(processColor)}
start={start}
end={end}
locations={locations}
/>
{ children }
</View>
);
}
}
var NativeLinearGradient = requireNativeComponent('BVLinearGradient', null);
module.exports = LinearGradient;