react-ionicons
Version:
A React SVG ionicon component
82 lines (64 loc) • 3.48 kB
JavaScript
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import SVG from './SVG'
class IosCar 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="M951.8 468c-28.8-32.6-82.4-61.6-82.4-61.6l31-6.2c0 0 0 0 0 0 14.2 0 44.8-4.6 51-10.8 6.2-6.4 8.4-10.8 8.4-16.4s-3.4-15.4-9.6-22.2c-6-6.8-32-10.4-47.4-12.4-15.2-2-17.4 0-21.4 2.4-4.6 3-6 23.4-6.4 34l-16.2 3.6c-9.6-25-22.8-71.2-43-108-23-41.6-47-54.8-57-58-9.8-3-18.8-5.2-86-12.2-67.4-7.2-126-8.2-160.8-8.2s-93.4 1-161.2 8.2c-67.2 6.8-76.2 9-86 12.2-10 3.2-34 16.4-57 58-20.2 36.8-33.4 83-43 108l-16.2-3.6c-0.4-10.6-1.8-31.2-6.4-34-4-2.6-6-4.4-21.4-2.4-15.2 2-41.2 5.6-47.4 12.4-6 6.8-9.4 16.6-9.4 22.2s2.2 10.2 8.4 16.6c6.2 6.4 37 10.8 51 10.8 0 0 0 0 0 0l31 6.2c0 0-53.6 29.2-82.4 61.6 0 0-8.2 49.4-8.2 116.2 0 96 11.6 176.8 11.6 176.8 53 9.2 92.4 12.6 131.8 13.6 19.8 0.4 37.8 0.4 58.4 0.2 49.6-0.6 31.2-15 54.2-14.6 22.6 0.4 110 8 192 8s169.4-7.6 192-8c23-0.4 4.6 14.2 54.2 14.6 20.6 0.2 38.8 0.2 58.4-0.2 39.4-1 79-4.4 131.8-13.6 0 0 11.6-80.6 11.6-176.8 0.2-67.2-8-116.4-8-116.4zM220.8 309.8c8.6-20.2 28-54.2 44.2-65.6 0 0 94-20.2 247-20.2s247 20.2 247 20.2c16.2 11.2 35.6 45.2 44.2 65.6 8.6 20.2 22.8 67.6 20.6 73s2.2 8.2-26.8 5.8c-28.8-2.2-199-4.6-285-4.6s-256.2 2.4-285 4.6c-29 2.4-24.8-0.4-26.8-5.8-2.2-5.6 12-52.8 20.6-73zM247.6 541.6c-19.8 0-59.6-2-69-2.4-9.4-0.2-17.6 7.6-22.4 7.6s-51-7.2-56-29.8c-5-22.4 0-46 0-45.6 31-1.4 61-0.4 117 15.6 56.2 15.8 87.2 46.6 87.2 46.6s-37 8-56.8 8zM684.4 679.6c-25.4 3.4-117 4.4-172.4 4.4s-147-1-172.4-4.4c-26.2-3.4-59.6-34.6-36.8-60.4 15.2-17 41.6-27.2 97.8-34.6 59.6-7.6 97.2-8.6 111.2-8.6s51.6 1 111.2 8.6c56.2 7.4 86.4 19.2 97.8 34.6 20.8 27.6-10.2 56.8-36.4 60.4zM923.8 517.2c-5 22.4-51.2 29.8-56 29.8s-13-7.8-22.4-7.6c-9.4 0.4-49.2 2.4-69 2.4s-56.8-8-56.8-8 31-30.8 87.2-46.6c56-16 86-17 117-15.6-0-0.4 5 23-0 45.6z M802 824.6c0 4.2 2.4 7.4 6.2 7.4 0 0 106 0 113 0 9.8 0 11.8-7 12.4-11 2.8-16.8 4-42.6 4-42.6-51.4 9.4-97.6 11-135.6 12v34.2z M90.2 821c0.6 4 2.6 11 12.4 11 7 0 113.4 0 113.4 0 3.8 0 6.2-3.2 6.2-7.4v-34.2c-38-1-84.4-2.6-135.8-12-0.2 0.2 1 25.8 3.8 42.6z"></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 ''
}
}
IosCar.defaultProps = {
// style
style: {},
color: '#000000',
fontSize: '22px',
// animation
shake: false,
beat: false,
rotate: false,
}
IosCar.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 IosCar