forked from magicismight/react-native-svg-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLine.js
87 lines (79 loc) · 1.59 KB
/
Line.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React, {
Component
} from 'react';
import Svg, {
Line
} from 'react-native-svg';
class LineExample extends Component{
static title = 'Line';
render() {
return <Svg
height="100"
width="100"
>
<Line
x1="10%"
y1="10%"
x2="90%"
y2="90%"
stroke="red"
strokeWidth="2"
/>
</Svg>;
}
}
class LineWithStrokeLinecap extends Component{
static title = 'Line';
render() {
return <Svg
height="100"
width="200"
>
<Line
x1="40"
y1="10"
x2="160"
y2="10"
stroke="red"
strokeWidth="10"
strokeLinecap="round"
/>
<Line
x1="40"
y1="40"
x2="160"
y2="40"
stroke="red"
strokeWidth="10"
strokeLinecap="butt"
/>
<Line
x1="40"
y1="80"
x2="160"
y2="80"
stroke="red"
strokeWidth="10"
strokeLinecap="square"
/>
</Svg>;
}
}
const icon = <Svg
height="20"
width="20"
>
<Line
x1="0"
y1="0"
x2="20"
y2="20"
stroke="red"
strokeWidth="1"
/>
</Svg>;
const samples = [LineExample, LineWithStrokeLinecap];
export {
icon,
samples
};