UNPKG

react-ionicons

Version:

A React SVG ionicon component

82 lines (64 loc) 3.22 kB
import React, { Component } from 'react' import PropTypes from 'prop-types' import SVG from './SVG' class LogoNodejs 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="M511.834 960c-11.54 0-23.072-3.124-33.266-9.198l-105.97-64.88c-15.828-9.124-8.046-12.406-2.886-14.282 21.13-7.562 27.426-11.314 49.894-24.57 2.412-1.334 5.494-0.848 7.91 0.644l79.42 47.008c2.952 1.7 7.114 1.7 9.862 0l310.376-184.492c2.95-1.754 4.83-5.292 4.83-8.882v-373.61c0-3.7-1.88-7.184-4.898-9.056l-310.24-189.344c-2.956-1.788-6.842-1.788-9.796 0l-310.038 189.41c-3.088 1.806-5.032 5.396-5.032 8.99v373.61c0 3.626 1.944 7.026 4.962 8.778l79.858 47.944c47.22 24.408 75.18-0.34 75.18-29.222v-367.398c0-5.304 4.094-9.454 9.192-9.454h45.618c5.030 0 9.194 4.144 9.194 9.454v367.396c0 65.126-38.706 102.496-98.398 102.496-18.312 0-32.794 0-73.104-20.558l-83.168-49.562c-20.592-12.304-33.334-35.292-33.334-59.91v-378.93c0-24.632 12.742-47.568 33.33-59.834l317.37-189.728c20.054-11.76 46.748-11.76 66.664 0l317.3 189.728c20.596 12.298 33.336 35.25 33.336 59.834v378.93c0 24.618-12.74 47.5-33.336 59.906l-317.3 189.548c-10.194 6.072-21.664 9.198-33.396 9.198l-0.134 0.036z M609.886 703.996c-129.22 0-168.012-63.22-168.012-118.542 0-5.258 4.096-9.458 9.124-9.458h41.042c4.564 0 8.454 3.4 9.124 8.032 6.168 43.204 33.496 62.3 108.648 62.3 66.798 0 94.182-20.692 94.182-57.368 0-21.184-6.926-36.848-110.814-47.394-86.854-8.882-140.576-28.746-140.576-100.59 0-66.27 53.992-104.98 144.468-104.98 92.256 0 152.924 28 158.346 101.658 0.204 2.674-0.736 5.258-2.482 7.288-1.742 1.93-4.156 3.054-6.706 3.054h-41.182c-4.292 0-8.048-3.124-8.918-7.426-8.802-33.906-33.94-46.804-99.126-46.804-72.972 0-81.492 25.506-81.492 45.214 0 23.926 10.062 30.882 108.588 44.344 97.522 13.326 143.866 32.234 143.866 103.104 0 71.562-57.616 117.566-158.15 117.566l0.070 0.002z"></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 '' } } LogoNodejs.defaultProps = { // style style: {}, color: '#000000', fontSize: '22px', // animation shake: false, beat: false, rotate: false, } LogoNodejs.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 LogoNodejs