UNPKG

react-ionicons

Version:

A React SVG ionicon component

82 lines (64 loc) 2.02 kB
import React, { Component } from 'react' import PropTypes from 'prop-types' import SVG from './SVG' class IosHelpCircle 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="M512 96c-229.8 0-416 186.2-416 416s186.2 416 416 416c229.8 0 416-186.2 416-416s-186.2-416-416-416zM520.6 732c-18.8 0-34-15-34-33.8 0-18.6 15.2-33.6 34-33.6s34 15 34 33.6c0 18.8-15.2 33.8-34 33.8zM588.2 501.4c-45.6 45-44.4 54.8-46.6 106.6h-38c2.2-57 15-87.4 60.2-129 22-20.6 38.8-45.4 38.8-76.2 0-47.2-38.8-79.8-85.2-79.8-64.8 0-97 32.8-95.8 92.8h-37.6c0.6-84 48.8-124.2 135.2-124.2 66 0 120.8 40.8 120.8 109.2 0 43.8-21.4 72.4-51.8 100.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 '' } } IosHelpCircle.defaultProps = { // style style: {}, color: '#000000', fontSize: '22px', // animation shake: false, beat: false, rotate: false, } IosHelpCircle.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 IosHelpCircle