UNPKG

react-ionicons

Version:

A React SVG ionicon component

82 lines (64 loc) 2.37 kB
import React, { Component } from 'react' import PropTypes from 'prop-types' import SVG from './SVG' class MdGameControllerB 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="M326 320h-48v62h-62v48h62v60h48v-60h60v-48h-60z M934.2 408.2c-10.4-126.2-95.4-216.2-214.2-216.2h-416c-118.8 0-203.6 90-214 216.2 0 0-26 269.4-26 327.8s43 96 96 96c26.2 0 50-10.6 68-27.8v0h-0.6l156.6-162.2h256l156.6 162-0.6 0.2c18 17.2 41.8 27.8 68 27.8 53 0 96-40.6 96-96s-25.8-327.8-25.8-327.8zM302 524c-66.2 0-120-54.2-120-121s53.8-121 120-121 120 54.2 120 121c0 66.8-53.8 121-120 121zM676.2 429.2c-14.4 14.4-38 14.4-52.4 0s-14.4-38 0-52.4c14.4-14.4 38-14.4 52.4 0s14.4 38 0 52.4zM751.2 504.2c-14.4 14.4-38 14.4-52.4 0s-14.4-38 0-52.4c14.4-14.4 38-14.4 52.4 0s14.4 38 0 52.4zM751.2 354.2c-14.4 14.4-38 14.4-52.4 0s-14.4-38 0-52.4c14.4-14.4 38-14.4 52.4 0s14.4 38 0 52.4zM826.2 429.2c-14.4 14.4-38 14.4-52.4 0s-14.4-38 0-52.4c14.4-14.4 38-14.4 52.4 0s14.4 38 0 52.4z"></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 '' } } MdGameControllerB.defaultProps = { // style style: {}, color: '#000000', fontSize: '22px', // animation shake: false, beat: false, rotate: false, } MdGameControllerB.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 MdGameControllerB