cinny/src/app/molecules/people-selector/PeopleSelector.jsx
Ajay Bura 4f09e6bbb5
(chore) remove outdated code (#1765)
* optimize room typing members hook

* remove unused code - WIP

* remove old code from initMatrix

* remove twemojify function

* remove old sanitize util

* delete old markdown util

* delete Math atom component

* uninstall unused dependencies

* remove old notification system

* decrypt message in inbox notification center and fix refresh in background

* improve notification

---------

Co-authored-by: Krishan <33421343+kfiven@users.noreply.github.com>
2024-07-08 21:27:10 +10:00

46 lines
1.2 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import './PeopleSelector.scss';
import { blurOnBubbling } from '../../atoms/button/script';
import Text from '../../atoms/text/Text';
import Avatar from '../../atoms/avatar/Avatar';
function PeopleSelector({ avatarSrc, name, color, peopleRole, onClick }) {
return (
<div className="people-selector__container">
<button
className="people-selector"
onMouseUp={(e) => blurOnBubbling(e, '.people-selector')}
onClick={onClick}
type="button"
>
<Avatar imageSrc={avatarSrc} text={name} bgColor={color} size="extra-small" />
<Text className="people-selector__name" variant="b1">
{name}
</Text>
{peopleRole !== null && (
<Text className="people-selector__role" variant="b3">
{peopleRole}
</Text>
)}
</button>
</div>
);
}
PeopleSelector.defaultProps = {
avatarSrc: null,
peopleRole: null,
};
PeopleSelector.propTypes = {
avatarSrc: PropTypes.string,
name: PropTypes.string.isRequired,
color: PropTypes.string.isRequired,
peopleRole: PropTypes.string,
onClick: PropTypes.func.isRequired,
};
export default PeopleSelector;