mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 22:05:14 +00:00
23 lines
520 B
JavaScript
23 lines
520 B
JavaScript
import React, {
|
|
Component,
|
|
PropTypes
|
|
} from 'react-native';
|
|
import Path from './Path';
|
|
|
|
class Polygon extends Component{
|
|
static displayName = 'Polygon';
|
|
static propTypes = {
|
|
points: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
};
|
|
render() {
|
|
let props = this.props;
|
|
let d = 'M' + props.points.trim().replace(/\s+/g, 'L') + 'z';
|
|
return <Path
|
|
{...props}
|
|
points={null}
|
|
d={d}
|
|
/>;
|
|
}
|
|
}
|
|
export default Polygon;
|