UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

21 lines 773 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const styles = require('./avatar-icon.scss'); class AvatarIcon extends React.Component { render() { let { avatarName } = this.props; const { fill, color, size } = this.props; if (avatarName && avatarName.length > 2) { avatarName = avatarName.slice(0, 2); } return (React.createElement("div", { id: this.props.id, style: { backgroundColor: fill, color, width: `${size}px`, height: `${size}px` }, className: styles.container }, avatarName)); } } AvatarIcon.defaultProps = { size: 32, color: 'inherit', fill: 'inherit', }; exports.AvatarIcon = AvatarIcon; //# sourceMappingURL=avatar-icon.js.map