react-ionicons
Version:
A React SVG ionicon component
121 lines (93 loc) • 7.18 kB
JavaScript
;
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 IosIonitronOutline = function (_Component) {
_inherits(IosIonitronOutline, _Component);
function IosIonitronOutline(props) {
_classCallCheck(this, IosIonitronOutline);
var _this = _possibleConstructorReturn(this, (IosIonitronOutline.__proto__ || Object.getPrototypeOf(IosIonitronOutline)).call(this, props));
_this.state = { classNames: [], animationActive: false };
_this._getClasses = _this._getClasses.bind(_this);
return _this;
}
_createClass(IosIonitronOutline, [{
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: 'M935.4 538.4c-8.6-61.8-28.8-114.6-67.6-114.6l-15.2 0.2c-61.2-124-188.4-207-333.2-207-7 0-14 0.2-21 0.6-171.6 9.6-309.4 133.4-343.4 293.6l-22.8 3.2c-34.4 4.8-53.8 69.6-43.2 145 10 72.4 44.2 128 77.2 128 1.4 0 2.8 0 4-0.2l31.4-4.4c65.8 107 184.2 177.4 317 177.4 7 0 14-0.2 21-0.6 170.4-9.4 307.6-131.8 342.8-290.4l14.8-0.8c30.4-5 47.6-62.8 38.2-130zM212.4 748.8l-46.2 6.4c-2.2-0.6-11.2-6-21.6-24.4-11.4-20-19.8-47-23.8-76s-3.2-57.2 2.2-79.6c5-20.4 12.2-28 14.2-29.4l43.2-6c14.4 25.8 27.2 60 33 98.6 6 41.8 8 81.4-1 110.4zM902.2 610.6c-3.6 16-8.6 23.6-11 26l-35 2-5.2 23.6c-8 35.8-21.6 69.8-40.6 101.4-18.8 31-42.2 58.8-69.8 82.4-57.2 49.2-127.4 77.4-202.8 81.6-6.4 0.4-12.8 0.6-19.2 0.6-58.8 0-116.8-15.4-167.8-44.4-49.8-28.4-92-69-121.8-117.8l-10.2-16.6c16-23.8 25.6-63.2 19.2-115-5.6-45.2-30.8-81-54.8-101.6l3.2-14.8c15.2-71.6 54.2-137.4 109.8-185.8 57.4-49.8 128.2-78.2 204.2-82.4 6.4-0.4 13.6-0.6 19.6-0.6 64.4 0 126.4 18 180.6 52 53.2 33.4 95.8 80.8 123.4 137l7.2 15c16.2 38 25 74.2 27.8 115 3-50.6-4.2-85.4-14.2-112l23-0.2c6.8 0 13.8 11.8 16.6 17 8.4 16 15 40.2 19.2 70.2 3.4 24.2 3 48.2-1.4 67.4z M543.961 698.821c16.985-0.944 31.519 12.059 32.464 29.044s-12.059 31.519-29.044 32.464c-16.985 0.944-31.519-12.059-32.464-29.044s12.059-31.519 29.044-32.464z M705.6 689.6c-17 1-30 15.4-29 32.4s15.4 30 32.4 29c17-1 30-15.4 29-32.4-0.8-17-15.4-30-32.4-29z M336 147.2c4.2 2.8 10 4.8 17.2 6 5 0.8 10.6 1.2 16.6 1.2 2.4 0 4.8 0 7.2-0.2 2 0 3.8-0.2 5.8-0.4-0.8-0.8-1.6-1.8-2.4-2.6-0.8 0-1.8 0-2.6 0s-1.6 0-2.4 0c-7.6 0-14.8-0.6-20.8-1.8-7-1.4-13.4-4.2-16.8-6.8-3.2-2.8-2.6-7.4-2.6-7.4 0.6-5.2 4.8-9.6 10.8-14.8 5.4-4.6 12.8-9.4 21.6-14l6.2-3c-1.6 6.6-1.8 13.8-0.4 21 4.2 21.8 21.8 37.8 42.8 40.8l9.4 46.2 31.6-6.4-9.2-45.6c18.8-10.2 29.6-31.6 25.6-53.8-1.4-7-4-13.4-7.8-19-3.6-0.6-8.6-1-14.4-1-11.2 0-26.2 1.2-44 5.2 2.2-0.6 4.2-1.4 6.4-2 15.2-4.2 29-7 43-8.4 17.2-2 30-0.6 33.2-0.2s6 1 8.6 1.8c-1.6 2.4-2.4 5.4-2.4 8.4 0 6.6 4.2 12.4 10 14.8-0.4 0.6-1 1.2-1.4 1.8-1.6 1.8-3.6 3.8-5.8 5.6s-4.4 3.6-7 5.4l-13 7.6c-0.2 1-0.4 2-0.6 3 0.2 0 0.4-0.2 0.4-0.2l16.6-9.4c2.4-1.6 4.8-3.2 6.8-4.8 2.4-1.8 4.4-3.6 6.2-5.6 0.6-0.6 1.4-1.4 2-2 0.6 0 1.2 0 1.8 0 8.8 0 16-7.2 16-16s-7.2-16-16-16c-3.2 0-6.2 1-8.8 2.6-3.6-1.6-7.2-2.6-12.8-3.6s-23.6-2.4-39.2-0.6c-6.2-4.6-17.8-8.4-27.8-8.4-3.2 0-6.2 0.2-9.4 0.8-15.8 3-28.4 13-35.4 26 0 0-23.4 9-39.2 23.4-6.4 5.8-10 12.8-10.6 16.6-1.4 5.8 0.6 11.6 7 15.8zM423.2 92.6c11.6 0 21 9.4 21 21s-9.4 21-21 21c-11.6 0-21-9.4-21-21s9.4-21 21-21z' })
);
}
}, {
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 IosIonitronOutline;
}(_react.Component);
IosIonitronOutline.defaultProps = {
// style
style: {},
color: '#000000',
fontSize: '22px',
// animation
shake: false,
beat: false,
rotate: false
};
IosIonitronOutline.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 = IosIonitronOutline;
module.exports = exports['default'];
//# sourceMappingURL=IosIonitronOutline.js.map