@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
53 lines (52 loc) • 1.7 kB
JavaScript
import React from 'react';
import { defaultProps } from "./props/defaultProps";
import { propTypes } from "./props/propTypes";
import { Icon } from '@zohodesk/icons';
import { Container } from '@zohodesk/components/lib/Layout';
import AvatarSize from '@zohodesk/components/lib/Provider/AvatarSize';
import style from "./AvatarIcon.module.css";
export default class AvatarIcon extends React.Component {
render() {
let {
name,
size,
iconSize,
iconClass,
iconColor,
onClick,
palette,
dataId,
className,
isIconBold,
title,
borderOnActive,
borderOnHover,
customProps,
dataSelectorId
} = this.props;
let {
AvatarIconProps = {}
} = customProps;
let border = borderOnHover || onClick;
return /*#__PURE__*/React.createElement(Container, {
className: `${style.container} ${borderOnActive ? style.borderOnActive : border ? style.borderOnHover : ''} ${AvatarSize(size)} ${style[palette] ? style[palette] : ''} ${className}`,
onClick: onClick,
dataId: dataId,
"data-title": title,
isInline: true,
align: "both",
isCover: false,
dataSelectorId: dataSelectorId,
...AvatarIconProps
}, /*#__PURE__*/React.createElement(Icon, {
name: name,
size: iconSize,
iconClass: ` ${iconClass} ${style.avatar_align_center} ${style.iconColor} ${iconColor ? ` ${style[`icon_${iconColor}`] ? style[`icon_${iconColor}`] : ''}` : ''} `,
isBold: isIconBold
}));
}
}
AvatarIcon.defaultProps = defaultProps;
AvatarIcon.propTypes = propTypes; // if (__DOCS__) {
// AvatarIcon.docs = { componentGroup: 'Avatar Group' };
// }