mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 06:07:41 +00:00
remove unused vars
This commit is contained in:
+28
-7
@@ -1,15 +1,18 @@
|
||||
import React, {
|
||||
Component,
|
||||
PropTypes,
|
||||
ReactNativeBaseComponent,
|
||||
ART
|
||||
} from 'react-native';
|
||||
|
||||
let {
|
||||
Shape,
|
||||
} = ART;
|
||||
Path
|
||||
} = ART;
|
||||
|
||||
import strokeFilter from '../lib/strokeFilter';
|
||||
import transformFilter from '../lib/transformFilter';
|
||||
let propType = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
||||
|
||||
class Line extends Component{
|
||||
static displayName = 'Line';
|
||||
static propTypes = {
|
||||
@@ -20,18 +23,36 @@ class Line extends Component{
|
||||
strokeLinecap: PropTypes.oneOf(['butt', 'square', 'round']),
|
||||
strokeCap: PropTypes.oneOf(['butt', 'square', 'round'])
|
||||
};
|
||||
render() {
|
||||
let {props} = this;
|
||||
let d = `M${props.x1},${props.y1}L${props.x2},${props.y2}Z`;
|
||||
|
||||
|
||||
_convertPath = (props = this.props) => {
|
||||
return `M${props.x1},${props.y1}L${props.x2},${props.y2}Z`;
|
||||
};
|
||||
|
||||
setNativeProps = (props) => {
|
||||
let nativeProps = {};
|
||||
if (props.x1 || props.x2 || props.y1 || props.y2) {
|
||||
let path = this._convertPath(Object.assign({}, this.props, props));
|
||||
nativeProps.d = new Path(path).toJSON();
|
||||
} else if (props.strokeLinecap || props.strokeCap) {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
this.refs.shape.setNativeProps(nativeProps);
|
||||
};
|
||||
|
||||
render() {
|
||||
return <Shape
|
||||
{...props}
|
||||
{...this.props}
|
||||
ref="shape"
|
||||
{...strokeFilter(this.props)}
|
||||
{...transformFilter(this.props)}
|
||||
x1={null}
|
||||
y1={null}
|
||||
x2={null}
|
||||
y2={null}
|
||||
fill={null}
|
||||
d={d}
|
||||
d={this._convertPath()}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user