-
Notifications
You must be signed in to change notification settings - Fork 8
/
LinePath.js
44 lines (42 loc) Β· 865 Bytes
/
LinePath.js
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
40
41
42
43
44
import React from 'react';
import Svg, {
LinearGradient,
Path,
Defs,
Stop
} from 'react-native-svg';
export function LinePath({
path,
primaryColor,
secondaryColor,
stopColor,
}) {
return (
<Svg
width='100%'
height='100%'
viewBox="0 0 369 66"
preserveAspectRatio="xMidYMid meet"
>
<Path
d={path}
stroke="url(#paint0_linear)"
strokeWidth="4"
/>
<Defs>
<LinearGradient
id="paint0_linear"
x1="185"
y1="66"
x2="185"
y2="-2.74149e-06"
gradientUnits="userSpaceOnUse"
>
<Stop stopColor={primaryColor} />
<Stop offset="0.787091" stopColor={secondaryColor} />
<Stop offset="1" stopColor={stopColor} stopOpacity="0" />
</LinearGradient>
</Defs>
</Svg>
);
}