UNPKG

1.59 kBJavaScriptView Raw
1import _extends from"@babel/runtime/helpers/extends";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _inherits from"@babel/runtime/helpers/inherits";var _jsxFileName="/Users/msand/WebstormProjects/react-native-svg/src/elements/Polygon.tsx";import React from'react';import Path from'./Path';import Shape from'./Shape';import extractPolyPoints from'../lib/extract/extractPolyPoints';var Polygon=function(_Shape){_inherits(Polygon,_Shape);function Polygon(){var _getPrototypeOf2;var _this;_classCallCheck(this,Polygon);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_possibleConstructorReturn(this,(_getPrototypeOf2=_getPrototypeOf(Polygon)).call.apply(_getPrototypeOf2,[this].concat(args)));_this.setNativeProps=function(props){var points=props.points;if(points){props.d="M"+extractPolyPoints(points)+"z";}_this.root&&_this.root.setNativeProps(props);};return _this;}_createClass(Polygon,[{key:"render",value:function render(){var props=this.props;var points=props.points;return React.createElement(Path,_extends({ref:this.refMethod,d:points&&"M"+extractPolyPoints(points)+"z"},props,{__source:{fileName:_jsxFileName,lineNumber:31}}));}}]);return Polygon;}(Shape);Polygon.displayName='Polygon';Polygon.defaultProps={points:''};export{Polygon as default};
2//# sourceMappingURL=Polygon.js.map
\No newline at end of file