UNPKG

react-ionicons

Version:

A React SVG ionicon component

82 lines (64 loc) 3.54 kB
import React, { Component } from 'react' import PropTypes from 'prop-types' import SVG from './SVG' class MdIonitron 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="M957.4 539.6c-9.4-66.8-37.4-123.6-71.4-119.6 13.6 30.6 24.2 73.6 20.6 150.6-3-54-13.2-104.8-36-150.6-67.4-135-211.4-224.4-372.6-215.4-180.4 10-325.4 139.4-361.2 306.6l-24 3.4c-36.2 5-56.6 72.8-45.6 151.4s49.4 138.4 85.6 133.4l33.2-4.6c72.8 117.6 206.8 193 355.6 184.8 179.2-9.8 323.4-137.8 360.4-303.4l15.4-1c31.8-5.2 49.8-65.6 40-135.6zM163.2 528.8c14.2 11.2 53 37 62.8 115.2s-17.8 117.8-30 134.2c12.6-31 13-78 6-129.4-6.8-50-19-93.4-38.8-120zM549.4 771.4c-17.8 1-33.2-12.6-34.2-30.4s12.6-32.8 30.6-33.8c17.8-1 33.2 12.6 34.2 30.4s-12.8 33-30.6 33.8zM719.4 761.8c-17.8 1-33.2-12.6-34.2-30.4s12.6-32.8 30.6-33.8c17.8-1 33.2 12.6 34.2 30.4 1 17.6-12.8 32.8-30.6 33.8z M321.2 123.4c0 0 0.2 0 0 0 0.2 0.2 0.2 0.4 0.2 0.4s0 0 0 0c0.2 0.4 0.4 0.8 0.6 1 0 0 0 0.2 0 0.2 0.8 2.2 2.4 4 4.8 5.8 4.2 3 10.4 5 18 6.2 7.2 1.2 15.8 1.4 25 1 2 0 4-0.2 6.2-0.4-0.8-1-1.8-1.8-2.6-2.8-1 0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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 '' } } MdIonitron.defaultProps = { // style style: {}, color: '#000000', fontSize: '22px', // animation shake: false, beat: false, rotate: false, } MdIonitron.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 MdIonitron