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