remove unused vars

This commit is contained in:
Horcrux
2016-04-19 15:18:16 +08:00
parent 669616167d
commit c8a04c3d28
17 changed files with 162 additions and 115 deletions
+28 -7
View File
@@ -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()}
/>;
}
}