react-ionicons
Version:
A React SVG ionicon component
121 lines (93 loc) • 6.47 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 IosIceCreamOutline = function (_Component) {
_inherits(IosIceCreamOutline, _Component);
function IosIceCreamOutline(props) {
_classCallCheck(this, IosIceCreamOutline);
var _this = _possibleConstructorReturn(this, (IosIceCreamOutline.__proto__ || Object.getPrototypeOf(IosIceCreamOutline)).call(this, props));
_this.state = { classNames: [], animationActive: false };
_this._getClasses = _this._getClasses.bind(_this);
return _this;
}
_createClass(IosIceCreamOutline, [{
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: 'M760.8 327.2c-12.8-6.2-24.8-9.2-24.8-9.2 0-123.8-100.2-226-224-226s-224 102.4-224 226.2c0 0-11.4 1.8-24.8 8.8-24.4 12.8-39.4 39.6-39.4 69 0 44.2 35.8 80 80 80 25 0 63.4-11.6 78.2-29.6 30.6 30.2 75.6 45.6 129.8 45.6s99.4-15.4 129.8-45.6c14.6 18 53 29.6 78.2 29.6 44.2 0 80-35.8 80-80 0.2-29.2-17.4-58.2-39-68.8zM720 444c-9 0-21.4-2.4-32.4-6.2-12.8-4.6-21-11.6-21-11.6-10.4-6.8-22.2-27.4-22.2-27.4l-25 24.8c-24 23.8-61 36.4-107.4 36.4-46.2 0-83.4-12.6-107.4-36.4l-25-24.8c0 0-9.2 17.8-22.2 27.4-4 3-8.2 7-21 11.6-10.8 3.8-23.2 6.2-32.4 6.2-26.6 0-48-21.6-48-48 0-16.4 8-31.2 21.4-40 0 0 8.2-5 16.2-7.8 9.2-3 16.8-4 16.8-4 20.2 15.6 42.8 21 42.8 21-17.4-12-32.8-43.4-32.8-43.4v-3.8c0-51.6 20-100.2 56.4-137 36-36.6 84.2-57 135.2-57s99.2 20.2 135.6 57c36.4 36.8 56.4 85.6 56.4 137v4.2c0 0-14 31.2-31.2 43.2 0 0 22.4-5.4 42.6-20.8 0 0 7-0.4 15 2.6s16.2 9 16.2 9c13.4 9 21.4 23.6 21.4 40 0 26.2-21.6 47.8-48 47.8z M382.2 480.4c-0.2 0.2-0.4 0.4-0.6 0.6l0.6-0.6c0.2 0.2 0 0 0 0z M642 480.4c-30.6 30.2-75.8 45.6-130 45.6-54 0-99.2-15.2-129.6-45.4l-0.8 0.4c-8 9.4-22.4 17-37.8 22l109.8 375c1.8 5.2 19 54 58.6 54 18.2 0 35-11.8 47.4-29.4 7.4-10.6 11.2-22.8 11.8-24.8l110.6-374c-16.4-5.4-32-13.4-40-23.4zM512.2 567.4l71.6 49.2-71.6 49.2-71.6-49.2 71.6-49.2zM395.6 585.6l-21.4-69.6 10-6c19 20.8 72.2 36.2 103.6 40.4l1 0.6-85.8 59-7.4-24.4zM410.6 637.2l6.4-4.4 71.6 49.2-54.2 37.2-23.8-82zM466.2 828.6l-11.2-38.6 33.6 23.2-22.4 15.4zM512.2 906c-22.6 0-34.2-36.8-34.2-36.8l-2-7.6 36.2-26.2 36.4 26.4-1.8 7.2c-0 0.2-11.4 37-34.6 37zM558.6 828.8l-22.8-15.6 34.2-23.6-11.4 39.2zM581.8 749l-69.6 48-69-47.4-0.8-3 70-48 70.4 48.4-1 2zM590.4 719.6l-54.6-37.6 71.6-49.2 7 4.8-24 82zM629.6 585l-7.4 25.4-14.8-10.2-71.6-49.2 1-0.6c31.2-4.2 74-16.4 103.4-37.6l8 5.2-18.6 67z' })
);
}
}, {
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 IosIceCreamOutline;
}(_react.Component);
IosIceCreamOutline.defaultProps = {
// style
style: {},
color: '#000000',
fontSize: '22px',
// animation
shake: false,
beat: false,
rotate: false
};
IosIceCreamOutline.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 = IosIceCreamOutline;
module.exports = exports['default'];
//# sourceMappingURL=IosIceCreamOutline.js.map