Add Symbol element refactor viewbox

Add Symbol element refactor viewbox
This commit is contained in:
Horcrux
2016-01-25 18:07:06 +08:00
parent 2556c2537e
commit 50b941c4bc
9 changed files with 256 additions and 83 deletions
+34
View File
@@ -0,0 +1,34 @@
import React, {
Component,
PropTypes,
ART
} from 'react-native';
import ViewBox from './ViewBox';
import Defs from './Defs';
import extractViewbox from '../lib/extractViewbox';
class Symbol extends Component{
static displayName = 'Symbol';
static propType = {
id: PropTypes.string.isRequired
};
render() {
let {props} = this;
return <Defs.Item
id={props.id}
svgId={props.svgId}
>
<ViewBox
viewbox={props.viewbox}
preserveAspectRatio={props.preserveAspectRatio}
width={props.width}
height={props.height}
shouldTransform={true}
>
{props.children}
</ViewBox>
</Defs.Item>
}
}
export default Symbol;