* Implement Profile Viewer Fixes #111 * Make user avatar in chat clickable * design progress * Refactored code * progress * Updated chip comp Signed-off-by: Ajay Bura <ajbura@gmail.com> * Refactored ProfileViewer comp Signed-off-by: Ajay Bura <ajbura@gmail.com> * Added msg functionality in ProfileViewer Signed-off-by: Ajay Bura <ajbura@gmail.com> * Added Ignore functionality in ProfileViewer Signed-off-by: Ajay Bura <ajbura@gmail.com> * Fixed Ignore btn bug Signed-off-by: Ajay Bura <ajbura@gmail.com> * Refectored ProfileViewer comp Signed-off-by: Ajay Bura <ajbura@gmail.com> Co-authored-by: Ajay Bura <ajbura@gmail.com>
38 lines
812 B
JavaScript
38 lines
812 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import './Chip.scss';
|
|
|
|
import Text from '../text/Text';
|
|
import RawIcon from '../system-icons/RawIcon';
|
|
|
|
function Chip({
|
|
iconSrc, iconColor, text, children,
|
|
onClick,
|
|
}) {
|
|
return (
|
|
<button className="chip" type="button" onClick={onClick}>
|
|
{iconSrc != null && <RawIcon src={iconSrc} color={iconColor} size="extra-small" />}
|
|
{(text != null && text !== '') && <Text variant="b3">{text}</Text>}
|
|
{children}
|
|
</button>
|
|
);
|
|
}
|
|
|
|
Chip.propTypes = {
|
|
iconSrc: PropTypes.string,
|
|
iconColor: PropTypes.string,
|
|
text: PropTypes.string,
|
|
children: PropTypes.element,
|
|
onClick: PropTypes.func,
|
|
};
|
|
|
|
Chip.defaultProps = {
|
|
iconSrc: null,
|
|
iconColor: null,
|
|
text: null,
|
|
children: null,
|
|
onClick: null,
|
|
};
|
|
|
|
export default Chip;
|