forked from calebnance/expo-spotify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinearGradient.js
More file actions
30 lines (26 loc) · 899 Bytes
/
Copy pathLinearGradient.js
File metadata and controls
30 lines (26 loc) · 899 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
import React from 'react';
import { Svg } from 'expo';
import PropTypes from 'prop-types';
import { colors } from '../api';
const LinearGradient = ({ fill, height }) => (
<Svg height={height} width="100%">
<Svg.Defs>
<Svg.LinearGradient id="grad" x1="50%" y1="100%" x2="50%" y2="0%">
<Svg.Stop offset="0%" stopColor={colors.blackBg} stopOpacity="1" />
<Svg.Stop offset="5%" stopColor={colors.blackBg} stopOpacity="1" />
<Svg.Stop offset="100%" stopColor={fill} stopOpacity="1" />
</Svg.LinearGradient>
</Svg.Defs>
<Svg.Rect x="0" y="0" width="100%" height="100%" fill="url(#grad)" />
</Svg>
);
LinearGradient.defaultProps = {
fill: colors.brandPrimary,
height: 320
};
LinearGradient.propTypes = {
// optional
fill: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
height: PropTypes.number
};
export default LinearGradient;