react-ionicons
Version:
A React SVG ionicon component
82 lines (64 loc) • 2.21 kB
JavaScript
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import SVG from './SVG'
class IosRose extends Component {
constructor(props) {
super(props)
this.state = {classNames: [], animationActive: false}
this._getClasses = this._getClasses.bind(this)
}
render() {
const style = {
...this.props.style,
color: this.props.color,
fontSize: this.props.fontSize,
}
return (
<SVG
style={this.props.style}
className={this._getClasses()}
fill={this.props.color}
width={this.props.fontSize}
height={this.props.fontSize}
viewBox="0 0 1024 1024"
onClick={this.props.onClick}
rotate={this.props.rotate ? 1 : 0}
shake={this.props.shake ? 1 : 0}
beat={this.props.beat ? 1 : 0}
>
<path d="M832 274.2c-37.8 7.8-73.6 16.4-107.4 25.6-81 22-151 47.8-210.8 74.4-38.6 17.2-52.4 24.8-103 51.8-116.8 61.8-186.8 128.6-186.8 264 0 135.6 111.2 238 288 238s288-102.4 288-238c0-135.4-122-237.4 32-415.8v0z M192 214.8c83 87.4 89.2 193 78.8 268.8 25.6-21 62.4-47.8 112.2-76.8 12.8-7.6 26.6-15.2 41.2-22.8 23.2-12.2 47-23.8 71.6-34.8-18.2-20.2-44.2-38.2-73.2-54-97.4-53-230.6-80.4-230.6-80.4v0z M704 155.4c0 0-157.2 4.4-261.4 116 33.2 18.4 59.4 38 78 58.6l5.4 6c74.4-31.2 176.2-63.4 242-78-12.8-43.4-64-102.6-64-102.6v0z M352 96c-30.6 41.6-51.4 84.2-60.6 111.4 42.2 11.8 71 24.6 122.8 49.4 19-21.2 40.8-40.2 65.2-56.8-58.8-75-127.4-104-127.4-104v0z"></path>
</SVG>
)
}
_getClasses() {
return [...this.state.classNames, this.props.className].join(' ')
}
_getPathByIconName() {
let icon = icons.find(icon => icon.tags[0] === this.props.icon)
if (icon) return icon.paths.join(' ')
return ''
}
}
IosRose.defaultProps = {
// style
style: {},
color: '#000000',
fontSize: '22px',
// animation
shake: false,
beat: false,
rotate: false,
}
IosRose.propTypes = {
// style
style: PropTypes.object,
color: PropTypes.string,
fontSize: PropTypes.string,
// animation
shake: PropTypes.bool,
beat: PropTypes.bool,
rotate: PropTypes.bool,
// functions
onClick: PropTypes.func
}
export default IosRose