UNPKG

react-ionicons

Version:

A React SVG ionicon component

121 lines (93 loc) 7.83 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _propTypes = require('prop-types'); var _propTypes2 = _interopRequireDefault(_propTypes); var _SVG = require('./SVG'); var _SVG2 = _interopRequireDefault(_SVG); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var LogoSass = function (_Component) { _inherits(LogoSass, _Component); function LogoSass(props) { _classCallCheck(this, LogoSass); var _this = _possibleConstructorReturn(this, (LogoSass.__proto__ || Object.getPrototypeOf(LogoSass)).call(this, props)); _this.state = { classNames: [], animationActive: false }; _this._getClasses = _this._getClasses.bind(_this); return _this; } _createClass(LogoSass, [{ key: 'render', value: function render() { var style = _extends({}, this.props.style, { color: this.props.color, fontSize: this.props.fontSize }); return _react2.default.createElement( _SVG2.default, { 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 }, _react2.default.createElement('path', { d: 'M1023.568 658.216c-3.34-27.198-18.472-48.292-41.59-64.832 5.714 4.080 10.55 7.532-0.11-0.082-14.378-10.262-6.76-4.822-0.094-0.064-57-40.602-131.352-31.578-193.466-9.022-24.894-40.59-25.974-71.566-11.632-115.874 1.858-5.6 0.59-8.708-5.248-11.208-14.172-6.060-34.582-2.854-48.844 0.926-4.924 1.292-8.508 3.8-9.6 8.762-10.308 48.486-42.018 92.896-69.656 133.772-19.462-37.304-17.92-66.174-4.828-105.032 1.596-4.732 0.862-7.248-3.874-9.758-14.52-7.514-36.802-3.824-51.6 0.552-17.018 4.964-42.58 89.188-50.744 105.892-17.062 34.884-32.182 89.33-61.17 117.004-24.6-31.614 45.052-103.034 21.764-131.702-7.876-9.696-22.126-9.446-31.172-1.232 2.17-15.216 3.296-25.218-0.64-38.126-4.162-13.58-14.722-21.374-30.18-20.98-35.99 1.054-67.686 27.63-89.282 52.794-20.554 24.21-74.762 39.254-103.906 53.854-50.064-43.614-158.442-89.894-161.264-164.162-3.056-83.692 96.638-140.49 163.194-174.456 86.56-44.208 219.922-99.216 318.276-50.872 26.098 12.828 36.598 40.342 29.414 66.696-18.736 68.732-94.396 114.586-160.206 135.614-32.378 10.35-67.938 18.054-102.2 16.052-45.91-2.686-81.66-30.448-86.562-32.172-4.098-0.778-3.776 4.522-2.694 7.328 47.632 124.866 288.834 33.362 351.912-30.742 30.378-30.842 48.826-60.73 56.702-107.788 9.232-55.166-31.268-89.684-62.008-103.914-155.836-72.144-371.272 22.336-489.106 118.654-51.136 41.802-115.104 108.22-85.748 177.892 31.86 75.61 129.472 114.38 193.006 160.624-51.408 25.546-115.724 51.966-149.036 99.866-19.048 27.458-25.806 56.718-11.622 87.932 25.144 55.136 116.57 31.244 155.146 6.942 35.34-22.26 59.126-52.14 69.4-90.456 8.91-33.218 7.082-67.732-7.712-99.024l57.17-28.916c-15.394 46.152-22.194 104.006 9.762 145.71 12.804 16.676 46.034 17.35 59.634 0.622 17.632-21.886 29.328-49.31 41.006-74.412-1.364 18.746-3.712 39.992 2.754 56.33 7.42 18.746 24.252 22.582 41.584 10.686 53.040-36.406 86.796-137.304 112.926-196.124 7.104 25.658 14.946 49.096 27.914 72.752 3.204 5.806 2.814 9.548-1.592 14.39-19.37 21.35-65.652 56.958-70.138 85.798-1.048 6.742 3.426 13.198 11.372 14.74 31.146 6.216 65.676-5.062 90.964-22.156 26.376-17.844 34.892-42.174 28.49-71.030-9.152-41.542 21.986-87.96 51.602-122.060 5.438 25.816 13.632 50.662 28.286 73.212-26.15 22.966-65.16 55.528-59.558 93.878 1.976 13.73 14.27 22.602 29.028 19.472 31.566-6.648 58.832-20.226 78.74-44.292 18.046-21.71 11.584-45.402 3.712-69.27 47.744-13.63 96.044-16.354 143.662-0.054 22.99 7.82 41.51 21 52.496 41.636 13.452 25.288 5.878 48.584-20.1 65.208-6.574 4.208-11.124 7.666-8.9 9.486 2.224 1.822 9.8 4.226 26.568-6.304 16.768-10.534 27.020-24.766 29.646-43.45 0.526-5.166 0.51-10.334-0.048-15.51zM225.892 708.734c-2.716 33.346-19.272 60.386-46.35 82.228-15.234 12.316-34.204 22.352-53.040 24.184-18.836 1.834-33.502-2.922-34.756-22.46-3.528-54.986 81.846-108.848 129.25-125.066 4.040 13.72 6.022 27.332 4.864 41.174l0.032-0.060zM432.096 563.828c-7.806 44.618-29.66 124.694-64.628 156.672-4.712 4.286-9.22 4.036-11.618-1.542-20.69-48.118 7.342-147.338 66.164-162.656 6.914-1.778 11.204 1.164 10.082 7.526zM572.718 727.364c16.844-17.924 33.668-35.832 50.538-53.854 2.086 20.042-35.142 59.928-50.538 53.854zM734.146 691.972c-4.696 2.546-15.242 5.030-15.654 1.67-2.964-24.17 23.632-49.748 40.134-61.734 8.906 22.686-1.636 47.668-24.48 60.064z' }) ); } }, { key: '_getClasses', value: function _getClasses() { return [].concat(_toConsumableArray(this.state.classNames), [this.props.className]).join(' '); } }, { key: '_getPathByIconName', value: function _getPathByIconName() { var _this2 = this; var icon = icons.find(function (icon) { return icon.tags[0] === _this2.props.icon; }); if (icon) return icon.paths.join(' '); return ''; } }]); return LogoSass; }(_react.Component); LogoSass.defaultProps = { // style style: {}, color: '#000000', fontSize: '22px', // animation shake: false, beat: false, rotate: false }; LogoSass.propTypes = { // style style: _propTypes2.default.object, color: _propTypes2.default.string, fontSize: _propTypes2.default.string, // animation shake: _propTypes2.default.bool, beat: _propTypes2.default.bool, rotate: _propTypes2.default.bool, // functions onClick: _propTypes2.default.func }; exports.default = LogoSass; module.exports = exports['default']; //# sourceMappingURL=LogoSass.js.map