Refactor reuse elements

Refactor reuse elements
This commit is contained in:
Horcrux
2016-01-25 11:39:31 +08:00
parent 5f3c2e8e39
commit e001285cbe
16 changed files with 171 additions and 101 deletions

View File

@@ -7,7 +7,8 @@ import Svg, {
Use,
G,
Rect,
Circle
Circle,
Polyline
} from 'react-native-art-svg';
class UseExample extends Component{
@@ -42,8 +43,8 @@ class UseShapes extends Component{
<G id="shape">
<Rect x="0" y="0" width="50" height="50" />
</G>
<Use href="#shape" x="75" y="50" fill="#0f0"/>
<Use href="#shape" x="110" y="0" stroke="#0ff" fill="#8a3" rotation="45" origin="25, 25"/>
<Use href="#shape" x="150" y="50" stroke="#0f0" fill="none"/>
</Svg>;
};
@@ -53,7 +54,13 @@ const icon = <Svg
height="20"
width="20"
>
<Polyline
points="5,0 2,2 2,4 6,6 3,8 6,10 7,12 5,14 8,16 9,18"
fill="none"
stroke="#8a3"
id="line"
/>
<Use href="#line" x="10" stroke="#3a8" />
</Svg>;
const samples = [UseExample, UseShapes];