Repository URL to install this package:
|
Version:
2.7.3 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const renderProps_1 = require("./renderProps");
const paths_1 = require("./paths");
class MaterialIcon extends react_1.default.PureComponent {
render() {
const {
className,
renderIcon,
renderWrapper,
type,
isDisabled,
isSelected,
onClick
} = this.props;
const label = type + ' icon';
const icon = renderIcon(this.props);
const attributes = {
className,
type,
isDisabled,
isSelected,
isInteractive: onClick !== undefined,
'aria-disabled': isDisabled,
'aria-label': label
};
return renderWrapper(this.props, attributes, icon);
}
}
MaterialIcon.defaultProps = {
type: 'empty',
isDisabled: false,
isSelected: false,
nowrap: false,
renderIcon: renderProps_1.defaultRenderIcon,
renderWrapper: renderProps_1.defaultWrapper,
pathAliases: paths_1.defaultPathAliases,
paths: paths_1.defaultPaths
};
exports.MaterialIcon = MaterialIcon;
exports.default = MaterialIcon; //# sourceMappingURL=MaterialIcon.js.map