mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 14:05:09 +00:00
Add examples and refactor code
Add examples and refactor code
This commit is contained in:
47
Example/examples/Line.js
Normal file
47
Example/examples/Line.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import React, {
|
||||
Component
|
||||
} from 'react-native';
|
||||
|
||||
import Svg, {
|
||||
Line
|
||||
} from 'react-native-art-svg';
|
||||
|
||||
class LineExample extends Component{
|
||||
static title = 'Line';
|
||||
render() {
|
||||
return <Svg
|
||||
height="100"
|
||||
width="100"
|
||||
>
|
||||
<Line
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="100"
|
||||
y2="100"
|
||||
stroke="red"
|
||||
strokeWidth="2"
|
||||
/>
|
||||
</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];
|
||||
|
||||
export {
|
||||
icon,
|
||||
samples
|
||||
}
|
||||
Reference in New Issue
Block a user